wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Grigorov <mgrigo...@apache.org>
Subject Re: validating a form that is not visible
Date Thu, 22 Jan 2015 11:57:47 GMT

I think you will need to write custom tabbed panel that hides the tabs with
JS on the client side.

The problem with Wicket's default TabbedPanel is that it sees only one tab
at a time - the active tab.
I.e. the component tree is something like
Switching the tabs replaces the content component and thus nestedFormX
becomes nestedFormY.

Martin Grigorov
Wicket Training and Consulting

On Thu, Jan 22, 2015 at 1:51 PM, Andrew Geery <andrew.geery@gmail.com>

> I have a top-level form.
> The top-level form contains two nested forms.
> The nested forms are inside of a TabbedPanel so only one is visible at a
> time.
> The save button for the top-level form is always visible.  The save button
> submits the top-level form and submitting the top-level form also has the
> effect of submitting the nested forms.
> This all is correct and works as it should.
> The issue is that Wicket (correctly) only validates the form that is on the
> tab that is visible.  The form that is on the tab that is not visible is
> not actually being submitted so it doesn't get validated.
> In the past, I've prevented the user from switching tabs if one of the tabs
> contained a validation error, but I can't do that in this case.
> When the top-level form is submitted, is there a way I can mark both forms
> as visible and have Wicket validate both forms?
> Thanks
> Andrew

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message