You are right about that not making sense.  Maybe the third time will be
the charm...  Here are the steps I'm dealing with.

 

1. user clicks on link that sets the input form to visible

 

2. user fills out half the form and then decides to press the cancel
button (an AjaxSubmitButton)

 

3. wicket doesn't process the cancel because not all the required fields
are filled in.

 

4. user fills out the rest of the form and then presses the cancel
button again

 

5. wicket sees all the required fields are filled and will now process
the cancel and hide the input form

 

6. the model is 'updated' to empty or null and the program goes on it's
merry way

 

I'm looking to cut out steps 3,4,5 and just hide the input form and set
the model to null.  Canceling is annoying if you have to fill in all the
required fields for it to work.

 

John

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Igor
Vaynberg
Sent: Thursday, June 14, 2007 12:47 PM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] AjaxSubmitButton - Cancel

 

you simply cannot do that, because it doesnt make sense

lets say you have add(new TextField("num", Integer.class)) and the user
enters "abc". if you skip the validation how do you expect to update the
model? you cannot convert abc to an integer so how do you expect it to
be pushed into the model's integer field? 

updating the model only makes sense if the validation passed

-igor

On 6/14/07, John Carlson < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:

Yes, skip validation on cancel and still refresh the model.  That's my 
stumbling block.

John

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto: <mailto:[EMAIL PROTECTED]>
[EMAIL PROTECTED] On Behalf Of Eelco
Hillenius
Sent: Thursday, June 14, 2007 9:29 AM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] AjaxSubmitButton - Cancel 

On 6/14/07, John Carlson <[EMAIL PROTECTED]> wrote:
> I have a form with two ajaxbuttons, submit and cancel.  The form has a
> number of textfields that validate themselves 'onblur' using 
> ajaxformcomponentupdatingbehaviour.  What is the cleanest way to have
> the cancel button ignore the validation that the submit button is
> following?   I know regular buttons have this ability via the 
> defaultformprocessing(false) but I want to update the form on cancel.
> The best I have brainstormed would be to have the cancel button
separate
> from the form and some how or the other call update on the form from 
> outside it.  Any thoughts would be appreciated.

So you want to skip validation, but update the models regardless?

Eelco

------------------------------------------------------------------------

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

------------------------------------------------------------------------
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take 
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list 
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user 

 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to