You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Marieke Vandamme <ma...@tvh.be> on 2010/10/27 08:59:56 UTC

Modalwindow with confirm box on close button

Hello, 

I want to aks the user if he is sure that he wants to close the 
modalwindow. 
Most of the time we use the modalwindow to edit a bean. But when closing 
the modalwindow with close button, we are not sure if the user wants to 
save the data or not. 
Using 'setCloseButtonCallback' is not an option, because showing the 
confirm-box should be just before going to server (or not if user doesn't 
confirm).

Thanks for any help !
Kind Regards, Marieke Vandamme
**** DISCLAIMER ****

http://www.tvh.com/newen2/emaildisclaimer/default.html 

"This message is delivered to all addressees subject to the conditions
set forth in the attached disclaimer, which is an integral part of this
message."

Betr.: Re: Modalwindow with confirm box on close button

Posted by Marieke Vandamme <ma...@tvh.be>.
Hello, 

Thanks for the response!
I already use jquery in my project for other stuff, so I would be a 
solution.

I hoped there was a standard fitted solution in wicket.
We override 'getEventHandler' often to override the onclick for a 
behavior,
so why can't there be something like that to override the onclick of the 
close button? 
Does it exist or should i put it as 'new feature'? 

Thanks, Marieke





Andrea Del Bene <ad...@ciseonweb.it> 
27/10/2010 16:23
Antwoord a.u.b. aan
users@wicket.apache.org


Aan
users@wicket.apache.org
Cc

Onderwerp
Re: Modalwindow with confirm box on close button






Hi Marieke,

some times ago I've solved a similar problem using JQuery and a plugin 
called jQuery AOP, but I don't know if exists a simpler solution. I used 
jQuery AOP with close button which is a standard anchor with class 
attribute set to 'w_close'. The following script will ask user to 
confirm before closing window without sending any data to server. I hope 
it could help you:


$('a.w_close').each(function(){
jQuery.aop.around( {target: this, method: 'onclick'},
                   function(invocation) {

                     if(confirm("Are you REALLY sure?")){
                         return invocation.proceed();
                     }else{
                         return false;
                     }
                   }
             );
});

bye.
> Hello,
>
> I want to aks the user if he is sure that he wants to close the
> modalwindow.
> Most of the time we use the modalwindow to edit a bean. But when closing
> the modalwindow with close button, we are not sure if the user wants to
> save the data or not.
> Using 'setCloseButtonCallback' is not an option, because showing the
> confirm-box should be just before going to server (or not if user 
doesn't
> confirm).
>
> Thanks for any help !
> Kind Regards, Marieke Vandamme
> **** DISCLAIMER ****
>
> http://www.tvh.com/newen2/emaildisclaimer/default.html
>
> "This message is delivered to all addressees subject to the conditions
> set forth in the attached disclaimer, which is an integral part of this
> message."
>
> 


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


**** DISCLAIMER ****

http://www.tvh.com/newen2/emaildisclaimer/default.html 

"This message is delivered to all addressees subject to the conditions
set forth in the attached disclaimer, which is an integral part of this
message."

Re: Modalwindow with confirm box on close button

Posted by Andrea Del Bene <ad...@ciseonweb.it>.
Hi Marieke,

some times ago I've solved a similar problem using JQuery and a plugin 
called jQuery AOP, but I don't know if exists a simpler solution. I used 
jQuery AOP with close button which is a standard anchor with class 
attribute set to 'w_close'. The following script will ask user to 
confirm before closing window without sending any data to server. I hope 
it could help you:


$('a.w_close').each(function(){
jQuery.aop.around( {target: this, method: 'onclick'},
                   function(invocation) {

                     if(confirm("Are you REALLY sure?")){
                         return invocation.proceed();
                     }else{
                         return false;
                     }
                   }
             );
});

bye.
> Hello,
>
> I want to aks the user if he is sure that he wants to close the
> modalwindow.
> Most of the time we use the modalwindow to edit a bean. But when closing
> the modalwindow with close button, we are not sure if the user wants to
> save the data or not.
> Using 'setCloseButtonCallback' is not an option, because showing the
> confirm-box should be just before going to server (or not if user doesn't
> confirm).
>
> Thanks for any help !
> Kind Regards, Marieke Vandamme
> **** DISCLAIMER ****
>
> http://www.tvh.com/newen2/emaildisclaimer/default.html
>
> "This message is delivered to all addressees subject to the conditions
> set forth in the attached disclaimer, which is an integral part of this
> message."
>
>    


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