Re: AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception

2011-06-06 Thread Tier
Thanks, it's help me with my problem.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-in-ModalWindow-throws-Submit-Button-is-not-visible-exception-tp3570446p3576210.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



AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception

2011-06-03 Thread Tier
Hello,

I have ModalWindow with form inside

html:

wicket:panel
form wicket:id=offerForm
   ...
div class=confirm
 wicket:message key=button.offer.reject / /p
/div
/form
/wicket:panel

java:

add(okButton = new AjaxSubmitLink(closeOK, this)  
{
@Override
protected void onSubmit(AjaxRequestTarget target, 
Form? form)
{
save();
window.close(target);
}
});

If I press button few times before it closes - it wicket will throw an
exception 

org.apache.wicket.WicketRuntimeException: Submit Button closeOK
(path=centralPanel:offerList:rejectOfferWindow:content:offerForm:closeOK) is
not visible
 at org.apache.wicket.markup.html.form.Form$2.component(Form.java:620)

Any ideas how fix this problem?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-in-ModalWindow-throws-Submit-Button-is-not-visible-exception-tp3570446p3570446.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: AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception

2011-06-03 Thread Martin Grigorov
Make the button disabled with JavaScript after the first click, or
raise a flag at server side that it is clicked and all further clicks
should be ignored if the flag is true

On Fri, Jun 3, 2011 at 1:03 PM, Tier vladimirsemas...@mail.ru wrote:
 Hello,

 I have ModalWindow with form inside

 html:

 wicket:panel
        form wicket:id=offerForm
           ...
        div class=confirm
         wicket:message key=button.offer.reject / /p
        /div
        /form
 /wicket:panel

 java:

 add(okButton = new AjaxSubmitLink(closeOK, this)
                {
                        @Override
                        protected void onSubmit(AjaxRequestTarget target, 
 Form? form)
                        {
                                save();
                                window.close(target);
                        }
                });

 If I press button few times before it closes - it wicket will throw an
 exception

 org.apache.wicket.WicketRuntimeException: Submit Button closeOK
 (path=centralPanel:offerList:rejectOfferWindow:content:offerForm:closeOK) is
 not visible
     at org.apache.wicket.markup.html.form.Form$2.component(Form.java:620)

 Any ideas how fix this problem?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-in-ModalWindow-throws-Submit-Button-is-not-visible-exception-tp3570446p3570446.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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception

2011-06-03 Thread Andrea Del Bene

Hi,
I guess the problem is method save() which delays  closing of the form 
and let you click few times consecutively. You can decorate your submit 
link with an IAjaxCallDecorator in order to disable link on the first click:


public class AjaxDisableComponentDecorator implements IAjaxCallDecorator{

private Component componentToHide;

public AjaxDisableComponentDecorator(Component componentToHide){
this.componentToHide = componentToHide;
}

@Override
public CharSequence decorateOnFailureScript(Component component, 
CharSequence script) {

//do nothing
}

@Override
public CharSequence decorateOnSuccessScript(Component component, 
CharSequence script) {

//do nothing
}

@Override
public CharSequence decorateScript(Component component, 
CharSequence script) {
return   disable component with 
id=componentToHide.getMarkupId() + '; +  script ;

}

}


Hello,

I have ModalWindow with form inside

html:

wicket:panel
form wicket:id=offerForm
...
div class=confirm
wicket:message key=button.offer.reject /  /p
/div
/form
/wicket:panel

java:

add(okButton = new AjaxSubmitLink(closeOK, this)
{
@Override
protected void onSubmit(AjaxRequestTarget target, 
Form?  form)
{
save();
window.close(target);
}
});

If I press button few times before it closes - it wicket will throw an
exception

org.apache.wicket.WicketRuntimeException: Submit Button closeOK
(path=centralPanel:offerList:rejectOfferWindow:content:offerForm:closeOK) is
not visible
  at org.apache.wicket.markup.html.form.Form$2.component(Form.java:620)

Any ideas how fix this problem?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-in-ModalWindow-throws-Submit-Button-is-not-visible-exception-tp3570446p3570446.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



AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception

2011-06-03 Thread Tier
Hello,

I have ModalWindow with form inside

html:

wicket:panel
form wicket:id=offerForm
   ...
div class=confirm
 wicket:message key=button.offer.reject / /p
/div
/form
/wicket:panel

java:

add(okButton = new AjaxSubmitLink(closeOK, this)  
{
@Override
protected void onSubmit(AjaxRequestTarget target, 
Form? form)
{
save();
window.close(target);
}
});

If I press button few times before it closes - it wicket will throw an
exception 

org.apache.wicket.WicketRuntimeException: Submit Button closeOK
(path=centralPanel:offerList:rejectOfferWindow:content:offerForm:closeOK) is
not visible
 at org.apache.wicket.markup.html.form.Form$2.component(Form.java:620)

Any ideas how fix this problem?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-in-ModalWindow-throws-Submit-Button-is-not-visible-exception-tp3570229p3570229.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