wicket-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Makundi <martin.maku...@koodaripalvelut.com>
Subject Re: Bug ? form.isMultiPart().anyEmbeddedMultipart picks multipart also from hidden items?
Date Tue, 26 Oct 2010 12:49:11 GMT
Ah.. ok. My bad, old version:

		visitChildren(Component.class, new IVisitor<Component>()
		{
			public Object component(Component component)
			{
				boolean isMultiPart = false;
				if (component instanceof Form)
				{
					Form<?> form = (Form<?>)component;
					isMultiPart = (form.multiPart != 0);
				}
				else if (component instanceof FormComponent)
				{
					FormComponent<?> form = (FormComponent<?>)component;
					isMultiPart = form.isMultiPart();
				}
				if (isMultiPart == true)
				{
					anyEmbeddedMultipart[0] = true;
					return STOP_TRAVERSAL;
				}
				return CONTINUE_TRAVERSAL;
			}

		});


2010/10/26 Martin Grigorov <mgrigorov@apache.org>:
> This is how the code looks (Form.java, 1.4-SNAPSHOT):
>
> visitChildren(Component.class, new IVisitor<Component>()
> {
> public Object component(Component component)
> {
> boolean isMultiPart = false;
> if (component instanceof Form)
> {
> Form<?> form = (Form<?>)component;
>
> if (form.isVisibleInHierarchy() && form.isEnabledInHierarchy())
> {
> isMultiPart = (form.multiPart != 0);
> }
> }
> else if (component instanceof FormComponent)
> {
> FormComponent<?> fc = (FormComponent<?>)component;
> if (fc.isVisibleInHierarchy() && fc.isEnabledInHierarchy())
> {
> isMultiPart = fc.isMultiPart();
> }
> }
>
> if (isMultiPart == true)
> {
> anyEmbeddedMultipart[0] = true;
> return STOP_TRAVERSAL;
> }
> return CONTINUE_TRAVERSAL;
> }
>
> });
>
> So it takes into account the visibility
>
> On Tue, Oct 26, 2010 at 2:20 PM, Martin Makundi <
> martin.makundi@koodaripalvelut.com> wrote:
>
>> Hi!
>>
>> Is it a bug or a feature that
>>
>> form.isMultiPart().anyEmbeddedMultipart
>>
>> picks ismultipart also from hidden nested forms (that are not visible
>> in hierarchy)?
>>
>> form
>>  modalwindow
>>      panel
>>           form-with-multipart-but-not-visible-before-modalwindow-is-opened
>>
>> **
>> Martin
>>
>

Mime
View raw message