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



Re: Preventing double-click of AjaxButtons in ModalWindow

2010-07-15 Thread Pedro Santos
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: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
>



-- 
Pedro Henrique Oliveira dos Santos