You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ian MacLarty <ia...@gmail.com> on 2009/04/09 06:45:26 UTC

Changing form validation depending on submit button.

Hi,

I have a form with two submit buttons.  I want the form to validate
differently depending on what submit button is pressed (i.e. I want to
use a different IFormValidator depending on what button is used to
submit the form).  How would I go about doing this?

Ian.

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


Re: Changing form validation depending on submit button.

Posted by Ian MacLarty <ia...@gmail.com>.
On Tue, Apr 14, 2009 at 1:59 AM, Igor Vaynberg <ig...@gmail.com> wrote:
> form#validate is final.
>

Not according to the 1.3.2 docs.  Also there is no Form#onValidate
method in 1.3.2.  I'm looking here:
http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/form/Form.html.

In any case I don't see how I could use this to do different
validation depending on which submit button was pressed.  The only way
I can see to do it is to put the validation in the onSubmit for each
button.  Is that right?

Cheers,
Ian.

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


Re: Changing form validation depending on submit button.

Posted by Igor Vaynberg <ig...@gmail.com>.
form#validate is final.

-igor

On Mon, Apr 13, 2009 at 12:38 AM, Ian MacLarty <ia...@gmail.com> wrote:
> On Fri, Apr 10, 2009 at 11:09 AM, Igor Vaynberg <ig...@gmail.com> wrote:
>> there is form#onvalidate()
>>
>
> You mean form#validate() I think.  Thanks for the pointer.
>
> Ian.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Changing form validation depending on submit button.

Posted by Ian MacLarty <ia...@gmail.com>.
On Fri, Apr 10, 2009 at 11:09 AM, Igor Vaynberg <ig...@gmail.com> wrote:
> there is form#onvalidate()
>

You mean form#validate() I think.  Thanks for the pointer.

Ian.

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


Re: Changing form validation depending on submit button.

Posted by Igor Vaynberg <ig...@gmail.com>.
there is form#onvalidate()

-igor

On Thu, Apr 9, 2009 at 5:05 PM, Ian MacLarty <ia...@gmail.com> wrote:
> On Thu, Apr 9, 2009 at 8:20 PM, John Krasnay <jo...@krasnay.ca> wrote:
>> Have a look here:
>>
>> http://cwiki.apache.org/WICKET/conditional-validation.html
>>
>
> Thanks.  That's pretty much what I ended up doing.  It seemed a bit
> kludgy to be doing validation in the onSubmit method.  It means I
> can't put my error handling code in onError where it should be.  Not a
> big deal though.
>
> Cheers,
> Ian.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Changing form validation depending on submit button.

Posted by Ian MacLarty <ia...@gmail.com>.
On Thu, Apr 9, 2009 at 8:20 PM, John Krasnay <jo...@krasnay.ca> wrote:
> Have a look here:
>
> http://cwiki.apache.org/WICKET/conditional-validation.html
>

Thanks.  That's pretty much what I ended up doing.  It seemed a bit
kludgy to be doing validation in the onSubmit method.  It means I
can't put my error handling code in onError where it should be.  Not a
big deal though.

Cheers,
Ian.

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


Re: Changing form validation depending on submit button.

Posted by John Krasnay <jo...@krasnay.ca>.
Have a look here:

http://cwiki.apache.org/WICKET/conditional-validation.html

jk

On Thu, Apr 09, 2009 at 02:45:26PM +1000, Ian MacLarty wrote:
> Hi,
> 
> I have a form with two submit buttons.  I want the form to validate
> differently depending on what submit button is pressed (i.e. I want to
> use a different IFormValidator depending on what button is used to
> submit the form).  How would I go about doing this?
> 
> Ian.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 

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