You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Tony Wu <e9...@gmail.com> on 2010/02/11 19:28:08 UTC

Hook Before Form Validation on a Button

For form submission I can override onSubmit to do my own processing, but is
there anything I can override that happens BEFORE the form validation? I
need to for example, based on which Button they press, .setRequired(false)
on some components before the form processing kicks in.

I tried @Override validate() to temporarily do nothing, but the form
validation still kicks in. And validateValidators() is final so can't be
overwritten.

Any ideas?

Re: Hook Before Form Validation on a Button

Posted by Igor Vaynberg <ig...@gmail.com>.
make your button setusedefaultformprocessing(false) and trigger
validation of the form yourself.

-igor

On Thu, Feb 11, 2010 at 10:28 AM, Tony Wu <e9...@gmail.com> wrote:
> For form submission I can override onSubmit to do my own processing, but is
> there anything I can override that happens BEFORE the form validation? I
> need to for example, based on which Button they press, .setRequired(false)
> on some components before the form processing kicks in.
>
> I tried @Override validate() to temporarily do nothing, but the form
> validation still kicks in. And validateValidators() is final so can't be
> overwritten.
>
> Any ideas?
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org