Hi again,

The discussion you point to is related to a case where it is not desired to
send the form. I may be wrong but if you need get the field value, you need
to have send the form (it is possible to post a single component without
sending the whole form but that's another discussion).

As you said, an AjaxLink does not send the form, whereas an AjaxButton
does. Setting addItemLink.setDefaultFormProcessing(false) seems to be a
good option here because it will send the form but will not process it and
you will get your field value (the user choice), using getValue() (but not
getModelObject, which might return null in that case). Thus, the onSubmit
(the one of the form) will not be called (once again, because the form has
not been processed), only the button#onSubmit will.

Hope this helps,
Sebastien.


On Tue, May 1, 2012 at 6:51 PM, cmagnollay <cmagnol...@gmail.com> wrote:

> Hmm,
>
> The reason I used AjaxLink was because of this post I saw regarding
> stopping
> button from submitting to the form. Could you elaborate on why I cannot use
> AjaxLink, like Igor seems to recommend? Should I do
> setDefaultFormProcessingBehavior(false) to have the button not submit the
> form and cause a redirect?
>
> Or perhaps, I am misunderstanding what he means. He is talking about
> "attaching" a link to the button, but I suppose I am just unsure what he is
> talking about.
>
> Here is the link to the post I am referring to:
>
>
> http://apache-wicket.1842946.n4.nabble.com/A-button-that-does-NOT-submit-form-td1849785.html
>
>
> Thank you for your help once again.
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/AutoCompleteField-returning-null-tp4600764p4601153.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to