Re: Cancelling ala AjaxLink vs AjaxButton
It turns out that it actually seems to work in IE. For what it's worth, the javascript isn't working correctly in a virtual install of Firefox 3.0.19. For all I know, could be related, in part, to our software packaging/management process. I'll try and test in a few different environments and confirm that this isn't a real problem. Thanks for staying with this thread. -Luther -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Cancelling-ala-AjaxLink-vs-AjaxButton-tp2717635p2718183.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: Cancelling ala AjaxLink vs AjaxButton
e form as a constructor argument it does not need to be > added to it unlike the Button component." but if I remove this line: > > add(cancel); > > wicket complains "WicketMessage: Unable to find component with id > 'cancel.button' ..." > > If I place data in the two fields and then click on cancel, > "Form.delegateSubmit" logs to the console followed by "Form.onSubmit" ... > but I don't initially see "cancel.button ..." log to the console. In fact, I > click the cancel button 4 more times before I actually see it echo it's > println to the console. It is odd. Then I don't see that line for 4 more > trys ... and then it happens again. If I vary the pace, I can get it to show > up unpredictably at different times. > > The docs also mention: "The default when there is a submitting > IFormSubmittingComponent is to first call onSubmit on that Component," ... > but I'm seeing the opposite here correct (assuming the button the submitting > component). > > Here is a series of 15 clicks on the "Cancel" Button: > > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > cancel.button AjaxButton.onSubmit(target) > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > cancel.button AjaxButton.onSubmit(target) > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > cancel.button AjaxButton.onSubmit(target) > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > cancel.button AjaxButton.onSubmit(target) > > And the same thing goes for the Submit button. Sometimes it echoes, > sometimes it doesn't and it it never actually closes the window. > > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > submit.button AjaxButton.onSubmit(target) > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > submit.button AjaxButton.onSubmit(target) > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > submit.button AjaxButton.onSubmit(target) > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > Form.delegateSubmit > Form.onSubmit > submit.button AjaxButton.onSubmit(target) > > > HTML here: > > > > > Name > maxlength="80" value="abcd"> > > > Summary > rows="6">abcd > > > > > wicket:message="value:Application.saveButton.label"/> > wicket:message="value:Application.cancelButton.label"/> > # key="Application.cancelButton.label"/> > > > > > > > Any thoughts would be appreciated. > > -Luther > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Cancelling-ala-AjaxLink-vs-AjaxButton-tp2717635p2718130.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: Cancelling ala AjaxLink vs AjaxButton
happens again. If I vary the pace, I can get it to show up unpredictably at different times. The docs also mention: "The default when there is a submitting IFormSubmittingComponent is to first call onSubmit on that Component," ... but I'm seeing the opposite here correct (assuming the button the submitting component). Here is a series of 15 clicks on the "Cancel" Button: Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit cancel.button AjaxButton.onSubmit(target) Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit cancel.button AjaxButton.onSubmit(target) Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit cancel.button AjaxButton.onSubmit(target) Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit cancel.button AjaxButton.onSubmit(target) And the same thing goes for the Submit button. Sometimes it echoes, sometimes it doesn't and it it never actually closes the window. Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit submit.button AjaxButton.onSubmit(target) Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit submit.button AjaxButton.onSubmit(target) Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit submit.button AjaxButton.onSubmit(target) Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit Form.delegateSubmit Form.onSubmit submit.button AjaxButton.onSubmit(target) HTML here: Name Summary abcd # Any thoughts would be appreciated. -Luther -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Cancelling-ala-AjaxLink-vs-AjaxButton-tp2717635p2718130.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: Cancelling ala AjaxLink vs AjaxButton
that should be enough, alternatively use AjaxLink instead -igor On Tue, Sep 28, 2010 at 10:49 AM, LutherBaker wrote: > > I am popping up a ModalWindow with a form - which has Cancel and Submit > buttons. Unfortunately, I can't get the Cancel button to close the window. > It keeps submitting to the validator, stays on the form and echos validation > text to the feedback panel. > > I can get it to work with an AjaxLink. > > > <a href="#" wicket:id="cancel.link"><wicket:message > key="Application.cancelButton.label"/></a> > <input wicket:id="cancel.button" type="button" > wicket:message="value:Application.cancelButton.label"/> > > > > final AjaxLink cancelLink = new > AjaxLink("cancel.link") { > private static final long serialVersionUID = > 1L; > > �...@override > public void onClick(final AjaxRequestTarget > target) { > modal.close(target); > } > > }; > add(cancelLink); > > final AjaxButton cancel = new > AjaxButton("cancel.button", > AreaEditorForm.this) { > private static final long serialVersionUID = > 1L; > > �...@override > protected void onSubmit(final > AjaxRequestTarget target, > final Form form) { > modal.close(target); > } > }; > cancel.setDefaultFormProcessing(false); > add(cancel); > > > I thought that I could set default form processing = false but that doesn't > seem to be enough. > > Thoughts? > > -Luther > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Cancelling-ala-AjaxLink-vs-AjaxButton-tp2717635p2717635.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
Cancelling ala AjaxLink vs AjaxButton
I am popping up a ModalWindow with a form - which has Cancel and Submit buttons. Unfortunately, I can't get the Cancel button to close the window. It keeps submitting to the validator, stays on the form and echos validation text to the feedback panel. I can get it to work with an AjaxLink. <a href="#" wicket:id="cancel.link"><wicket:message key="Application.cancelButton.label"/></a> <input wicket:id="cancel.button" type="button" wicket:message="value:Application.cancelButton.label"/> final AjaxLink cancelLink = new AjaxLink("cancel.link") { private static final long serialVersionUID = 1L; @Override public void onClick(final AjaxRequestTarget target) { modal.close(target); } }; add(cancelLink); final AjaxButton cancel = new AjaxButton("cancel.button", AreaEditorForm.this) { private static final long serialVersionUID = 1L; @Override protected void onSubmit(final AjaxRequestTarget target, final Form form) { modal.close(target); } }; cancel.setDefaultFormProcessing(false); add(cancel); I thought that I could set default form processing = false but that doesn't seem to be enough. Thoughts? -Luther -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Cancelling-ala-AjaxLink-vs-AjaxButton-tp2717635p2717635.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