You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Richard W. Adams" <RW...@UP.COM> on 2013/09/10 14:58:48 UTC

Cancel Button Conundrum

I need to create a Cancel button that warns the user about saved data on a 
form before leaving the page. Thus, I can't call setDefaultFormProcessing
(false), since that would cause the data not be transferred to the model. 
But I ALSO don't want the page to complain about missing or invalid 
fields.

What's the best way to accomplish these goals?


**

This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient.  Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law.  If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies.
**

Re: Cancel Button Conundrum

Posted by Sven Meier <sv...@meiers.net>.
You can show a ModalDialog via Ajax or use a JavaScript-only solution.

Sven

On 09/10/2013 02:58 PM, Richard W. Adams wrote:
> I need to create a Cancel button that warns the user about saved data on a
> form before leaving the page. Thus, I can't call setDefaultFormProcessing
> (false), since that would cause the data not be transferred to the model.
> But I ALSO don't want the page to complain about missing or invalid
> fields.
>
> What's the best way to accomplish these goals?
>
>
> **
>
> This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient.  Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law.  If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies.
> **
>


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


RE: Cancel Button Conundrum

Posted by Paul Bors <pa...@bors.ws>.
You add two different submit buttons in the HTML and label them different.
Then for each one you run the different save business logic inside their own
onSubmit() methods.

There is nothing preventing you from submitting a form from different submit
buttons.

~ Thank you,
  Paul Bors

-----Original Message-----
From: Richard W. Adams [mailto:RWADAMS1@UP.COM] 
Sent: Tuesday, September 10, 2013 8:59 AM
To: users@wicket.apache.org
Subject: Cancel Button Conundrum

I need to create a Cancel button that warns the user about saved data on a
form before leaving the page. Thus, I can't call setDefaultFormProcessing
(false), since that would cause the data not be transferred to the model. 
But I ALSO don't want the page to complain about missing or invalid fields.

What's the best way to accomplish these goals?


**

This email and any attachments may contain information that is confidential
and/or privileged for the sole use of the intended recipient.  Any use,
review, disclosure, copying, distribution or reliance by others, and any
forwarding of this email or its contents, without the express permission of
the sender is strictly prohibited by law.  If you are not the intended
recipient, please contact the sender immediately, delete the e-mail and
destroy all copies.
**


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