Ah.. ok. My bad, old version:
visitChildren(Component.class, new IVisitorComponent()
{
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 mgrigo...@apache.org:
This is how the code looks (Form.java, 1.4-SNAPSHOT):
visitChildren(Component.class, new IVisitorComponent()
{
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.maku...@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