You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Kaspar Fischer <fi...@inf.ethz.ch> on 2008/11/06 08:57:02 UTC

Need AjaxButton's but not its enclosing form's onSubmit() to be called

I have a form with an onSubmit(). The form contains a AjaxButton
with another onSubmit(). When the later gets called, the former gets
invoked, too. What I want, however, is that the form's onSubmit()
gets called iff the <input type="submit">-button is clicked, and that
the AjaxButton's onSubmit() is called iff the <input type="button">-
button is pressed.

How can I achieve this?

I tried calling setDefaultFormProcessing(false) on my AjaxButton,
but that does not update the form values (not what I want). I also
tried form.setDefaultButton(null) or form.setDefaultButton(submit),
which didn't help either.

Thanks,
Kaspar

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


Re: Need AjaxButton's but not its enclosing form's onSubmit() to be called

Posted by Kaspar Fischer <fi...@inf.ethz.ch>.
On 06.11.2008, at 09:06, Igor Vaynberg wrote:

> take your code out of form.onsubmit and put it into onsubmit of the
> button attached to <input type="submit">, if there isnt one then
> attach one.
>
> -igor

Arrg... So simple. And I have been banging my head against this for
an hour now. Thanks, Igor!

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


Re: Need AjaxButton's but not its enclosing form's onSubmit() to be called

Posted by Igor Vaynberg <ig...@gmail.com>.
take your code out of form.onsubmit and put it into onsubmit of the
button attached to <input type="submit">, if there isnt one then
attach one.

-igor

On Wed, Nov 5, 2008 at 11:57 PM, Kaspar Fischer <fi...@inf.ethz.ch> wrote:
> I have a form with an onSubmit(). The form contains a AjaxButton
> with another onSubmit(). When the later gets called, the former gets
> invoked, too. What I want, however, is that the form's onSubmit()
> gets called iff the <input type="submit">-button is clicked, and that
> the AjaxButton's onSubmit() is called iff the <input type="button">-
> button is pressed.
>
> How can I achieve this?
>
> I tried calling setDefaultFormProcessing(false) on my AjaxButton,
> but that does not update the form values (not what I want). I also
> tried form.setDefaultButton(null) or form.setDefaultButton(submit),
> which didn't help either.
>
> Thanks,
> Kaspar
>
> ---------------------------------------------------------------------
> 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