You are hereBlogs / rahul's blog / FormPanel validation always succeeds without a Layout being a direct and only child of it

FormPanel validation always succeeds without a Layout being a direct and only child of it


rahul's picture

By rahul - Posted on 22 December 2009

Checkout this link in the Coolite examples explorer. It demonstrates validating controls that are inside a FormPanel. I was working on a similar control hierarchy, but the isValid() method on FormPanel's form was always returning true, even when the form was invalid.

Then I decided to test and compare the example code, and the one I was using. After some testing, I noticed that the only meaningful difference between the 2 was that my FormPanel had 3 Panels in its body (each of them was independently collapsible, the reason I had 3 of them), each of which further contained controls. And the validation was always succeeding.

Having figured that out, I changed my markup to intrroduce a RowLayout as the only child of the FormPanel, and moved the 3 Panels inside 3 LayoutRow elements of the RowLayout. That made the form to validate successfully.

The attached aspx file is a direct copy from the refrenced Coolite examples explorer, just introducing a Panel as the direct child of FormPanel, and moving everything else inside the Panel to prove my point.

AttachmentSize
Default.aspx3.78 KB

Post new comment

The content of this field is kept private and will not be shown publicly.

Mollom CAPTCHA (play audio CAPTCHA)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.