RE: Suppress Ajax ComponentNotFoundException

2012-06-28 Thread Alex Grant
Thank you.
I don't think either of those will work (though I will try them) as

* The update event is (I assume - but don't know as I can't reproduce the 
problem myself) being generated in the browser before the modal window is 
closed.
* The canCallListenerInterface method is invoked after the component has been 
found - so it's already too late.

Alex

-Original Message-
From: W Mazur [mailto:wlodekma...@gmail.com] 
Sent: Monday, 25 June 2012 8:48 p.m.
To: users@wicket.apache.org
Subject: Re: Suppress Ajax ComponentNotFoundException

I would  try to add WindowClosedCallback to Modal Window and remove
behavior(s) in that callback (unless you are going to reuse that ModalWindow).

Another option: try to override Behavior's canCallListenerInterface()

Regards
Wlodek

2012/6/25 Alex Grant :
> I have a problem that shows up intermittently (and never when I try to 
> reproduce it).
>
> We have ModalWindows that contain fields with associated 
> AjaxFormComponentUpdatingBehaviors on the onblur event. These work great 
> while the ModalWindow is open but sometimes events are received out of 
> sequence and we get an update event firing after ModalWindow is closed. 
> Wicket the throws a ComponentNotFoundException and the users sees the error 
> page.
>
> Is there some way I can prevent these happening, or at least suppress them? 
> All the field values will have been submitted when the ModalWindow was closed 
> so the extra update event can be safely ignored.
>
> Thanks
>
> Alex Grant.
> -
> 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


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



Suppress Ajax ComponentNotFoundException

2012-06-24 Thread Alex Grant
I have a problem that shows up intermittently (and never when I try to 
reproduce it). 

We have ModalWindows that contain fields with associated 
AjaxFormComponentUpdatingBehaviors on the onblur event. These work great while 
the ModalWindow is open but sometimes events are received out of sequence and 
we get an update event firing after ModalWindow is closed. Wicket the throws a 
ComponentNotFoundException and the users sees the error page. 

Is there some way I can prevent these happening, or at least suppress them? All 
the field values will have been submitted when the ModalWindow was closed so 
the extra update event can be safely ignored. 

Thanks

Alex Grant. 
-
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-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 wrote:

> 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



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



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


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:



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: Preventing double-click of AjaxButtons in ModalWindow

2010-07-15 Thread Alex Grant
That's perfect, thank you for the help.

Alex

-Original Message-
From: Pedro Santos [mailto:pedros...@gmail.com] 
Sent: Friday, 16 July 2010 12:07 a.m.
To: users@wicket.apache.org
Subject: Re: Preventing double-click of AjaxButtons in ModalWindow

You can use an IAjaxCallDecorator to disable buttons and re-enable them with 
the ajax request completes

On Wed, Jul 14, 2010 at 7:53 PM, Alex Grant wrote:

> I have ModalWindows whose content contains OK AjaxButtons, which, 
> assuming validation passes, will do some processing and then close the 
> ModalWindow.
>
> If a user enters valid data and then double-clicks the OK button they 
> will get an Exception like this one, because Wicket has already 
> processed the closing of the ModalWindow in the first click and the 
> button is therefore no longer on the screen for the second click.
>
> org.apache.wicket.WicketRuntimeException: Submit Button 
> tabbedPanel:panel:form:view:productsForm:manageProductsPanel:addProduc
> tPanel:content:editForm:ok
> (path=wizard:tabbedPanel:tabForm:tabbedPanel:panel:form:view:productsF
> orm:manageProductsPanel:addProductPanel:content:editForm:ok)
> is not visible
> at org.apache.wicket.markup.html.form.Form$2.component(Form.java:620)
>
> Is there some way to prevent this? If the buttons could be disabled in 
> javascript and re-enabled with the ajax request completes, or even if 
> this particular error could be suppressed and ignored if I knew that 
> the submitting button was in a closed ModalWindow.
>
> Alex
>



--
Pedro Henrique Oliveira dos Santos

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



Preventing double-click of AjaxButtons in ModalWindow

2010-07-14 Thread Alex Grant
I have ModalWindows whose content contains OK AjaxButtons, which, assuming 
validation passes, will do some processing and then close the ModalWindow.

If a user enters valid data and then double-clicks the OK button they will get 
an Exception like this one, because Wicket has already processed the closing of 
the ModalWindow in the first click and the button is therefore no longer on the 
screen for the second click.

org.apache.wicket.WicketRuntimeException: Submit Button 
tabbedPanel:panel:form:view:productsForm:manageProductsPanel:addProductPanel:content:editForm:ok
 
(path=wizard:tabbedPanel:tabForm:tabbedPanel:panel:form:view:productsForm:manageProductsPanel:addProductPanel:content:editForm:ok)
 is not visible
at org.apache.wicket.markup.html.form.Form$2.component(Form.java:620)

Is there some way to prevent this? If the buttons could be disabled in 
javascript and re-enabled with the ajax request completes, or even if this 
particular error could be suppressed and ignored if I knew that the submitting 
button was in a closed ModalWindow.

Alex