RE: Disable button double-click without breaking Form.setDefaultButton

2010-10-31 Thread Alex Grant
Thank you for your help, problem solved.

-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: Friday, 29 October 2010 5:59 p.m.
To: users@wicket.apache.org
Subject: Re: Disable button double-click without breaking Form.setDefaultButton

Do it in your form itself.  For instance, you can save a boolean flag that 
tells you that the form has already been submitted and not accept a second 
submit, or whatever.

On Thu, Oct 28, 2010 at 9:58 PM, Alex Grant alex.gr...@unimarket.comwrote:

 Thanks,

 That was actually me asking that question. :) That worked perfectly 
 for AjaxButtons, but what I'm trying to do now is disable double-click 
 for non-ajax buttons.

 Alex

 -Original Message-
 From: Alexander Morozov [mailto:alexander.v.moro...@gmail.com]
 Sent: Friday, 29 October 2010 3:31 p.m.
 To: users@wicket.apache.org
 Subject: Re: Disable button double-click without breaking 
 Form.setDefaultButton


 Check this thread

 http://apache-wicket.1842946.n4.nabble.com/Preventing-double-click-of-
 AjaxButtons-in-ModalWindow-td2289480.html
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Disable-button-double-click
 -without-breaking-Form-setDefaultButton-tp3018140p3018370.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


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




--
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

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



Disable button double-click without breaking Form.setDefaultButton

2010-10-28 Thread Alex Grant
Hello,

I have had problems with users double-clicking the Finish button in one of our 
wizards, which caused duplicate objects to be created.

So I want to prevent the (non-ajax) buttons from being clicked more than once. 
I found what I thought was a good solution, using a SimpleAttributeModifier to 
add this to all the regular buttons
input ... onclick=this.onclick=function(){return false;};/

This worked fine, until someone discovered pressing Enter in a textfield in a 
wizard stopped working, not only did it not submit the form, but it prevented 
clicking the button manually. Wizard makes uses of Form.setDefaultButton, which 
adds a hidden button at the start of the form, with an onclick handler that 
looks like this:

input ... onclick=var b=document.getElementById('next2d'); if 
(b!=nullb.onclick!=nulltypeof(b.onclick) != 'undefined') {  var r = 
b.onclick.bind(b)(); if (r != false) b.click(); } else { b.click(); };  return 
false; /

This meant that the onclick() method of my button was invoked (disabling the 
button), and then the button was clicked (doing nothing).

Has anyone found a way of disabling double-click on regular buttons without 
tripping over this?

Thank you,
Alex


Re: Disable button double-click without breaking Form.setDefaultButton

2010-10-28 Thread Alexander Morozov

Check this thread
http://apache-wicket.1842946.n4.nabble.com/Preventing-double-click-of-AjaxButtons-in-ModalWindow-td2289480.html
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Disable-button-double-click-without-breaking-Form-setDefaultButton-tp3018140p3018370.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



RE: Disable button double-click without breaking Form.setDefaultButton

2010-10-28 Thread Alex Grant
Thanks,

That was actually me asking that question. :)
That worked perfectly for AjaxButtons, but what I'm trying to do now is disable 
double-click for non-ajax buttons.

Alex

-Original Message-
From: Alexander Morozov [mailto:alexander.v.moro...@gmail.com] 
Sent: Friday, 29 October 2010 3:31 p.m.
To: users@wicket.apache.org
Subject: Re: Disable button double-click without breaking Form.setDefaultButton


Check this thread
http://apache-wicket.1842946.n4.nabble.com/Preventing-double-click-of-AjaxButtons-in-ModalWindow-td2289480.html
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Disable-button-double-click-without-breaking-Form-setDefaultButton-tp3018140p3018370.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


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



Re: Disable button double-click without breaking Form.setDefaultButton

2010-10-28 Thread Jeremy Thomerson
Do it in your form itself.  For instance, you can save a boolean flag that
tells you that the form has already been submitted and not accept a second
submit, or whatever.

On Thu, Oct 28, 2010 at 9:58 PM, Alex Grant alex.gr...@unimarket.comwrote:

 Thanks,

 That was actually me asking that question. :)
 That worked perfectly for AjaxButtons, but what I'm trying to do now is
 disable double-click for non-ajax buttons.

 Alex

 -Original Message-
 From: Alexander Morozov [mailto:alexander.v.moro...@gmail.com]
 Sent: Friday, 29 October 2010 3:31 p.m.
 To: users@wicket.apache.org
 Subject: Re: Disable button double-click without breaking
 Form.setDefaultButton


 Check this thread

 http://apache-wicket.1842946.n4.nabble.com/Preventing-double-click-of-AjaxButtons-in-ModalWindow-td2289480.html
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Disable-button-double-click-without-breaking-Form-setDefaultButton-tp3018140p3018370.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


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




-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*