You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Benjamin Lorenz <be...@kapowtech.com> on 2010/11/03 10:14:01 UTC

Multiple submit buttons - CompoundPropertyModel not updated

Hello,

I have a problem with a form that shall have two submit buttons. One finally submits the form with all plausibility checks, etc... the other just opens up a search form, to lookup some data for inclusion in the form. This submit shall NOT do all the checks on e.g. .setRequired(true), etc..., but it DOES HAVE to update my CompoundPropertyModel values, to deal with the user's (partially) entered values so far.

I cannot get this together: setDefaultFormProcessing(false) will not update my models, setDefaultFormProcessing(true) will finally submit my form, also calling the form's onSubmit, which is not what I want. 

I am using an anonymous form class with the default onSubmit(), and an additionally attached Button, which has its own onSubmit().

Do you understand what I mean, and can anybody point me to the right direction? It seems to me like a very basic, fundamental thing to do, two form buttons, that deal - independently from each other - with the entered data, but it seems to be tricky nevertheless...

Thanks,
Benjamin



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


Re: Multiple submit buttons - CompoundPropertyModel not updated

Posted by Igor Vaynberg <ig...@gmail.com>.
You cannot update models without default processing, what If the user typed
"abc"into a text field backed by an integer model? What you can do, however,
is accesses the raw value of the component via getvalue method.

-igor

On Nov 3, 2010 2:37 AM, "Benjamin Lorenz" <be...@kapowtech.com>
wrote:

Hello,

I have a problem with a form that shall have two submit buttons. One finally
submits the form with all plausibility checks, etc... the other just opens
up a search form, to lookup some data for inclusion in the form. This submit
shall NOT do all the checks on e.g. .setRequired(true), etc..., but it DOES
HAVE to update my CompoundPropertyModel values, to deal with the user's
(partially) entered values so far.

I cannot get this together: setDefaultFormProcessing(false) will not update
my models, setDefaultFormProcessing(true) will finally submit my form, also
calling the form's onSubmit, which is not what I want.

I am using an anonymous form class with the default onSubmit(), and an
additionally attached Button, which has its own onSubmit().

Do you understand what I mean, and can anybody point me to the right
direction? It seems to me like a very basic, fundamental thing to do, two
form buttons, that deal - independently from each other - with the entered
data, but it seems to be tricky nevertheless...

Thanks,
Benjamin



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