Hi all,

I have two forms nested within each other (wicket 1.4.17). The inner form adds data to the model of the outer form via ajax when it's button is pressed while the outer form saves the data to the database when the outer form's submit button is pressed.

Both forms have validators attacehd to them and their components. and of course the inner form's validators must not be executed when the outer form is submitted. Having the inner form implement IFormVisitorParticipant and then check if the submitting button was it's own avoids the inner form's component's validators to be executed. But validators applied to the inner form directly (e.g. EqualInputValidators etc.) are still executed and in my case causing the request to die horribly because the requred data just is not there.

I was looking for an elegant way to solve this but since all validate methods in the hierarchy are final I cannot hook any code into the form's on validation cycle. The method onValidate is not called (I guess that is because the form is validated as the outer form's child). All other methods that allow me to achieve the deisred behavior (like isEnabled) are too general cause side effects like disabling the form. At the moment the only way I can think of is to disable default form processing and then call the validators manually which is not very appealing to me.

Is there another way how this can be done?

Cheers,
Chris

--
The Sanity Resort <http://sanityresort.blogspot.com/>

Reply via email to