You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alex Grant <al...@unimarket.com> on 2010/07/15 00:53:51 UTC

Preventing double-click of AjaxButtons in ModalWindow

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

RE: Preventing double-click of AjaxButtons in ModalWindow

Posted by Alex Grant <al...@unimarket.com>.
That's perfect, thank you for the help.

Alex

-----Original Message-----
From: Pedro Santos [mailto:pedrosans@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 <al...@unimarket.com>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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Preventing double-click of AjaxButtons in ModalWindow

Posted by Pedro Santos <pe...@gmail.com>.
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 <al...@unimarket.com>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