Re: AjaxSubmitLink not working
This may not be the issue, but it's good practice to always include an onError method in the anonymous class. Once you add that, put a break point there & see what turns up. From: Entropy To: users@wicket.apache.org Date: 02/15/2017 11:55 AM Subject:AjaxSubmitLink not working This email originated from outside of the company. Please use discretion if opening attachments or clicking on links. I have a header links section in my header that must build in a dynamic way. AjaxSubmitLink link = new AjaxSubmitLink(linkName, formToSubmit) { @Override public void onSubmit(AjaxRequestTarget target, Form form) { //control never gets here. } }; That is being built in a function call that is called from a loop (though I don't think that matters). The HTML (of one example): <li wicket:id="contactLi"><a wicket:id="contactLink" href="/contact">Contact Information</a></li> In the wicket ajax debug window, I am getting this: INFO: focus removed from INFO: focus set on startLinkc INFO: Received ajax response (69 characters) INFO: INFO: Response processed successfully. INFO: refocus last focused component not needed/allowed Implying that it ran, but did nothing? There are no validators in place (yet) on the form. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-not-working-tp4677120.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: AjaxSubmitLink not working
Okay, I just did. Control does not get there either. BTW, if onError is something we should always override, perhaps it should be abstract? Still mystified -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-not-working-tp4677120p4677122.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 not working
On Wed, Feb 15, 2017 at 6:51 PM, Entropy wrote: > I have a header links section in my header that must build in a dynamic > way. > > AjaxSubmitLink link = new AjaxSubmitLink(linkName, > formToSubmit) { > @Override > public void onSubmit(AjaxRequestTarget target, > Form form) { > //control never gets here. > } > Always override #onError() too ! > }; > > That is being built in a function call that is called from a loop (though I > don't think that matters). The HTML (of one example): > > <li wicket:id="contactLi"><a wicket:id="contactLink" > href="/contact">Contact Information</a></li> > > In the wicket ajax debug window, I am getting this: > > INFO: focus removed from > > INFO: focus set on startLinkc > > INFO: Received ajax response (69 characters) > > INFO: > > > INFO: Response processed successfully. > > INFO: refocus last focused component not needed/allowed > > Implying that it ran, but did nothing? There are no validators in place > (yet) on the form. > > > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/AjaxSubmitLink-not-working-tp4677120.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 not working
I have a header links section in my header that must build in a dynamic way. AjaxSubmitLink link = new AjaxSubmitLink(linkName, formToSubmit) { @Override public void onSubmit(AjaxRequestTarget target, Form form) { //control never gets here. } }; That is being built in a function call that is called from a loop (though I don't think that matters). The HTML (of one example): <li wicket:id="contactLi"><a wicket:id="contactLink" href="/contact">Contact Information</a></li> In the wicket ajax debug window, I am getting this: INFO: focus removed from INFO: focus set on startLinkc INFO: Received ajax response (69 characters) INFO: INFO: Response processed successfully. INFO: refocus last focused component not needed/allowed Implying that it ran, but did nothing? There are no validators in place (yet) on the form. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-not-working-tp4677120.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 + setResponsePage = feedback message problem on new page
> but I am not getting feedback message when there is some error. In case of a redirection, you need to notify the message to the session, not to the page/component. ie: Session.get().warn(message); On Thu, May 19, 2016 at 11:04 AM, Martin Grigorov wrote: > Hi, > > If you use AjaxLink then you don't submit any data. You may try > AjaxSubmitLink instead. > > Please give more information about "but setResponsePage is not working". > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > On Thu, May 19, 2016 at 10:11 AM, Sarang wrote: > > > Hello Josh, > > > > I am stuck in similar situation only. When I hit on the link, I want to > > show > > feedback message if there are some mandatory fields unfilled otherwise I > > want to redirect using setResponsePage. If i use AjaxLink then I get > > feedback message properly but setResponsePage is not working. When I use > > SubmitLink, setResponsePage works fine but I am not getting feedback > > message > > when there is some error. > > > > Can you please suggest how can I solve this ? > > > > Thanks, > > Sarang > > > > -- > > View this message in context: > > > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-setResponsePage-feedback-message-problem-on-new-page-tp1843719p4674751.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 + setResponsePage = feedback message problem on new page
Hi, If you use AjaxLink then you don't submit any data. You may try AjaxSubmitLink instead. Please give more information about "but setResponsePage is not working". Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, May 19, 2016 at 10:11 AM, Sarang wrote: > Hello Josh, > > I am stuck in similar situation only. When I hit on the link, I want to > show > feedback message if there are some mandatory fields unfilled otherwise I > want to redirect using setResponsePage. If i use AjaxLink then I get > feedback message properly but setResponsePage is not working. When I use > SubmitLink, setResponsePage works fine but I am not getting feedback > message > when there is some error. > > Can you please suggest how can I solve this ? > > Thanks, > Sarang > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-setResponsePage-feedback-message-problem-on-new-page-tp1843719p4674751.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 + setResponsePage = feedback message problem on new page
Hello Josh, I am stuck in similar situation only. When I hit on the link, I want to show feedback message if there are some mandatory fields unfilled otherwise I want to redirect using setResponsePage. If i use AjaxLink then I get feedback message properly but setResponsePage is not working. When I use SubmitLink, setResponsePage works fine but I am not getting feedback message when there is some error. Can you please suggest how can I solve this ? Thanks, Sarang -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-setResponsePage-feedback-message-problem-on-new-page-tp1843719p4674751.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: Wicket 7: Problem hiding form from AjaxSubmitLink
Done! thank you guys. On 14/04/2015 08:44, Martin Grigorov wrote: Hi, I think Sven's solution is more generic. Also it will be consistent with WICKET-5597 On Apr 13, 2015 5:20 PM, "Sven Meier" wrote: Well, then we should change the type attribute as well, i.e. from "submit" to "button". Why not just use #setPreventDefault(true)? Because if JavaScript is disabled, the browser will still submit the form, without triggering the callback on the AjaxSubmitLink. Regards Sven Am 13.04.2015 um 18:01 schrieb andrea del bene: The case pointed out by Don is slightly different as the AjaxSubmitLink is attached to a tag. Adding 'attributes.setPreventDefault(true);' in updateAttributes actually solves his problem. On 13/04/2015 14:32, Sven Meier wrote: Hi Andrea, since WICKET-5597 AjaxSubmitLink already changes the button to prevent default submitting of the form: tag.put("type", "button"); Have fun Sven Am 13.04.2015 um 14:19 schrieb Andrea Del Bene: Due to WICKET-5197 I think we should add to 'attributes.setPreventDefault(true);' to AjaxSubmitLink Hi, Please create a quickstart app and attach it to a ticket at JIRA. Thanks! On Apr 12, 2015 9:43 PM, "Don Ferguson" wrote: Dear Wicket Boffins, I have a Wicket 6 app that I’ve recently migrated to Wicket 7. In the app there is a form whose AjaxSubmitLink hides the form as part of the submit. In Wicket7, this causes a ListenerInvocationNotAllowedException to be thrown, since the component that submitted the form is no longer visible. What is the approved “wicket way” to do what I’m attempting? Thanks in advance. -Don Here’s a stripped down version of the code: JAVA: public class TestPage extends WebPage { public TestPage() { Form form = new Form("form"); form.add(new AjaxSubmitLink("submit") { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(target, form); form.setVisible(false); target.add(form); } }); add(form.setOutputMarkupPlaceholderTag(true)); } } HTML: http://www.w3.org/1999/xhtml"; xmlns:wicket=" http://wicket.apache.org";> Test Form Submit Hides Form Form Element EXCEPTION THROWN ON SUBMIT: org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException: Component rejected interface invocationComponent: [Form [Component id = form]] Listener: [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] at org.apache.wicket.RequestListenerInterface.invoke( RequestListenerInterface.java:212) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandle r.invokeListener(ListenerInterfaceRequestHandler.java:241) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandle r.respond(ListenerInterfaceRequestHandler.java:234) … - 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 - 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
Re: Wicket 7: Problem hiding form from AjaxSubmitLink
Hi, I think Sven's solution is more generic. Also it will be consistent with WICKET-5597 On Apr 13, 2015 5:20 PM, "Sven Meier" wrote: > Well, then we should change the type attribute as well, i.e. from "submit" > to "button". > > Why not just use #setPreventDefault(true)? Because if JavaScript is > disabled, the browser will still submit the form, without triggering the > callback on the AjaxSubmitLink. > > Regards > Sven > > > Am 13.04.2015 um 18:01 schrieb andrea del bene: > >> The case pointed out by Don is slightly different as the AjaxSubmitLink >> is attached to a tag. Adding >> 'attributes.setPreventDefault(true);' in updateAttributes actually >> solves his problem. >> >> On 13/04/2015 14:32, Sven Meier wrote: >> >>> Hi Andrea, >>> >>> since WICKET-5597 AjaxSubmitLink already changes the button to prevent >>> default submitting of the form: >>> >>> tag.put("type", "button"); >>> >>> Have fun >>> Sven >>> >>> >>> Am 13.04.2015 um 14:19 schrieb Andrea Del Bene: >>> >>>> Due to WICKET-5197 I think we should add to >>>> 'attributes.setPreventDefault(true);' to AjaxSubmitLink >>>> >>>>> Hi, >>>>> >>>>> Please create a quickstart app and attach it to a ticket at JIRA. >>>>> Thanks! >>>>> On Apr 12, 2015 9:43 PM, "Don Ferguson" >>>>> wrote: >>>>> >>>>> Dear Wicket Boffins, >>>>>> >>>>>> I have a Wicket 6 app that I’ve recently migrated to Wicket 7. In >>>>>> the >>>>>> app there is a form whose AjaxSubmitLink hides the form as part of the >>>>>> submit. In Wicket7, this causes a ListenerInvocationNotAllowedException >>>>>> to >>>>>> be thrown, since the component that submitted the form is no longer >>>>>> visible. What is the approved “wicket way” to do what I’m attempting? >>>>>> >>>>>> Thanks in advance. >>>>>> >>>>>> -Don >>>>>> >>>>>> Here’s a stripped down version of the code: >>>>>> >>>>>> JAVA: >>>>>> >>>>>> public class TestPage extends WebPage { >>>>>> public TestPage() { >>>>>> Form form = new Form("form"); >>>>>> form.add(new AjaxSubmitLink("submit") { >>>>>> @Override >>>>>> protected void onSubmit(AjaxRequestTarget target, Form >>>>>> form) { >>>>>> super.onSubmit(target, form); >>>>>> form.setVisible(false); >>>>>> target.add(form); >>>>>> } >>>>>> }); >>>>>> add(form.setOutputMarkupPlaceholderTag(true)); >>>>>> } >>>>>> } >>>>>> >>>>>> HTML: >>>>>> http://www.w3.org/1999/xhtml"; xmlns:wicket=" >>>>>> http://wicket.apache.org";> >>>>>> >>>>>>Test Form Submit Hides Form >>>>>> >>>>>> >>>>>>Form Element >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> EXCEPTION THROWN ON SUBMIT: >>>>>> org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException: >>>>>> >>>>>> Component rejected interface invocationComponent: [Form [Component id >>>>>> = >>>>>> form]] Listener: [RequestListenerInterface name=IFormSubmitListener, >>>>>> method=public abstract void >>>>>> org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] >>>>>> >>>>>> at >>>>>> org.apache.wicket.RequestListenerInterface.invoke( >>>>>> RequestListenerInterface.java:212) >>>>>> at >>>>>> org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandle >>>>>> r.invokeListener(ListenerInterfaceRequestHandler.java:241) >>>>>> at >>>>>> org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandle >>>>>> r.respond(ListenerInterfaceRequestHandler.java:234) >>>>>> … >>>>>> >>>>>> >>>>>> - >>>>>> 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 >>> >>> >> >> - >> 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: Wicket 7: Problem hiding form from AjaxSubmitLink
Well, then we should change the type attribute as well, i.e. from "submit" to "button". Why not just use #setPreventDefault(true)? Because if JavaScript is disabled, the browser will still submit the form, without triggering the callback on the AjaxSubmitLink. Regards Sven Am 13.04.2015 um 18:01 schrieb andrea del bene: The case pointed out by Don is slightly different as the AjaxSubmitLink is attached to a tag. Adding 'attributes.setPreventDefault(true);' in updateAttributes actually solves his problem. On 13/04/2015 14:32, Sven Meier wrote: Hi Andrea, since WICKET-5597 AjaxSubmitLink already changes the button to prevent default submitting of the form: tag.put("type", "button"); Have fun Sven Am 13.04.2015 um 14:19 schrieb Andrea Del Bene: Due to WICKET-5197 I think we should add to 'attributes.setPreventDefault(true);' to AjaxSubmitLink Hi, Please create a quickstart app and attach it to a ticket at JIRA. Thanks! On Apr 12, 2015 9:43 PM, "Don Ferguson" wrote: Dear Wicket Boffins, I have a Wicket 6 app that I’ve recently migrated to Wicket 7. In the app there is a form whose AjaxSubmitLink hides the form as part of the submit. In Wicket7, this causes a ListenerInvocationNotAllowedException to be thrown, since the component that submitted the form is no longer visible. What is the approved “wicket way” to do what I’m attempting? Thanks in advance. -Don Here’s a stripped down version of the code: JAVA: public class TestPage extends WebPage { public TestPage() { Form form = new Form("form"); form.add(new AjaxSubmitLink("submit") { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(target, form); form.setVisible(false); target.add(form); } }); add(form.setOutputMarkupPlaceholderTag(true)); } } HTML: http://www.w3.org/1999/xhtml"; xmlns:wicket=" http://wicket.apache.org";> Test Form Submit Hides Form Form Element EXCEPTION THROWN ON SUBMIT: org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException: Component rejected interface invocationComponent: [Form [Component id = form]] Listener: [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:212) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:241) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234) … - 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 - 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: Wicket 7: Problem hiding form from AjaxSubmitLink
Done. https://issues.apache.org/jira/browse/WICKET-5879 <https://issues.apache.org/jira/browse/WICKET-5879> > On Apr 12, 2015, at 12:47 PM, Martin Grigorov wrote: > > Hi, > > Please create a quickstart app and attach it to a ticket at JIRA. > Thanks! > On Apr 12, 2015 9:43 PM, "Don Ferguson" wrote: > >> Dear Wicket Boffins, >> >> I have a Wicket 6 app that I’ve recently migrated to Wicket 7. In the >> app there is a form whose AjaxSubmitLink hides the form as part of the >> submit. In Wicket7, this causes a ListenerInvocationNotAllowedException to >> be thrown, since the component that submitted the form is no longer >> visible. What is the approved “wicket way” to do what I’m attempting? >> >> Thanks in advance. >> >> -Don >> >> Here’s a stripped down version of the code: >> >> JAVA: >> >> public class TestPage extends WebPage { >>public TestPage() { >>Form form = new Form("form"); >>form.add(new AjaxSubmitLink("submit") { >>@Override >>protected void onSubmit(AjaxRequestTarget target, Form >> form) { >>super.onSubmit(target, form); >>form.setVisible(false); >>target.add(form); >>} >>}); >>add(form.setOutputMarkupPlaceholderTag(true)); >>} >> } >> >> HTML: >> http://www.w3.org/1999/xhtml"; xmlns:wicket=" >> http://wicket.apache.org";> >> >> Test Form Submit Hides Form >> >> >> Form Element >> >> >> >> >> >> EXCEPTION THROWN ON SUBMIT: >> org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException: >> Component rejected interface invocationComponent: [Form [Component id = >> form]] Listener: [RequestListenerInterface name=IFormSubmitListener, >> method=public abstract void >> org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] >>at >> org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:212) >>at >> org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:241) >>at >> org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234) >> … >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >>
Re: Wicket 7: Problem hiding form from AjaxSubmitLink
The case pointed out by Don is slightly different as the AjaxSubmitLink is attached to a tag. Adding 'attributes.setPreventDefault(true);' in updateAttributes actually solves his problem. On 13/04/2015 14:32, Sven Meier wrote: Hi Andrea, since WICKET-5597 AjaxSubmitLink already changes the button to prevent default submitting of the form: tag.put("type", "button"); Have fun Sven Am 13.04.2015 um 14:19 schrieb Andrea Del Bene: Due to WICKET-5197 I think we should add to 'attributes.setPreventDefault(true);' to AjaxSubmitLink Hi, Please create a quickstart app and attach it to a ticket at JIRA. Thanks! On Apr 12, 2015 9:43 PM, "Don Ferguson" wrote: Dear Wicket Boffins, I have a Wicket 6 app that I’ve recently migrated to Wicket 7. In the app there is a form whose AjaxSubmitLink hides the form as part of the submit. In Wicket7, this causes a ListenerInvocationNotAllowedException to be thrown, since the component that submitted the form is no longer visible. What is the approved “wicket way” to do what I’m attempting? Thanks in advance. -Don Here’s a stripped down version of the code: JAVA: public class TestPage extends WebPage { public TestPage() { Form form = new Form("form"); form.add(new AjaxSubmitLink("submit") { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(target, form); form.setVisible(false); target.add(form); } }); add(form.setOutputMarkupPlaceholderTag(true)); } } HTML: http://www.w3.org/1999/xhtml"; xmlns:wicket=" http://wicket.apache.org";> Test Form Submit Hides Form Form Element EXCEPTION THROWN ON SUBMIT: org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException: Component rejected interface invocationComponent: [Form [Component id = form]] Listener: [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:212) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:241) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234) … - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 7: Problem hiding form from AjaxSubmitLink
Hi Andrea, since WICKET-5597 AjaxSubmitLink already changes the button to prevent default submitting of the form: tag.put("type", "button"); Have fun Sven Am 13.04.2015 um 14:19 schrieb Andrea Del Bene: Due to WICKET-5197 I think we should add to 'attributes.setPreventDefault(true);' to AjaxSubmitLink Hi, Please create a quickstart app and attach it to a ticket at JIRA. Thanks! On Apr 12, 2015 9:43 PM, "Don Ferguson" wrote: Dear Wicket Boffins, I have a Wicket 6 app that I’ve recently migrated to Wicket 7. In the app there is a form whose AjaxSubmitLink hides the form as part of the submit. In Wicket7, this causes a ListenerInvocationNotAllowedException to be thrown, since the component that submitted the form is no longer visible. What is the approved “wicket way” to do what I’m attempting? Thanks in advance. -Don Here’s a stripped down version of the code: JAVA: public class TestPage extends WebPage { public TestPage() { Form form = new Form("form"); form.add(new AjaxSubmitLink("submit") { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(target, form); form.setVisible(false); target.add(form); } }); add(form.setOutputMarkupPlaceholderTag(true)); } } HTML: http://www.w3.org/1999/xhtml"; xmlns:wicket=" http://wicket.apache.org";> Test Form Submit Hides Form Form Element EXCEPTION THROWN ON SUBMIT: org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException: Component rejected interface invocationComponent: [Form [Component id = form]] Listener: [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:212) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:241) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234) … - 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
Re: Wicket 7: Problem hiding form from AjaxSubmitLink
Due to WICKET-5197 I think we should add to 'attributes.setPreventDefault(true);' to AjaxSubmitLink Hi, Please create a quickstart app and attach it to a ticket at JIRA. Thanks! On Apr 12, 2015 9:43 PM, "Don Ferguson" wrote: Dear Wicket Boffins, I have a Wicket 6 app that I’ve recently migrated to Wicket 7. In the app there is a form whose AjaxSubmitLink hides the form as part of the submit. In Wicket7, this causes a ListenerInvocationNotAllowedException to be thrown, since the component that submitted the form is no longer visible. What is the approved “wicket way” to do what I’m attempting? Thanks in advance. -Don Here’s a stripped down version of the code: JAVA: public class TestPage extends WebPage { public TestPage() { Form form = new Form("form"); form.add(new AjaxSubmitLink("submit") { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(target, form); form.setVisible(false); target.add(form); } }); add(form.setOutputMarkupPlaceholderTag(true)); } } HTML: http://www.w3.org/1999/xhtml"; xmlns:wicket=" http://wicket.apache.org";> Test Form Submit Hides Form Form Element EXCEPTION THROWN ON SUBMIT: org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException: Component rejected interface invocationComponent: [Form [Component id = form]] Listener: [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:212) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:241) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234) … - 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: Wicket 7: Problem hiding form from AjaxSubmitLink
Hi, Please create a quickstart app and attach it to a ticket at JIRA. Thanks! On Apr 12, 2015 9:43 PM, "Don Ferguson" wrote: > Dear Wicket Boffins, > > I have a Wicket 6 app that I’ve recently migrated to Wicket 7. In the > app there is a form whose AjaxSubmitLink hides the form as part of the > submit. In Wicket7, this causes a ListenerInvocationNotAllowedException to > be thrown, since the component that submitted the form is no longer > visible. What is the approved “wicket way” to do what I’m attempting? > > Thanks in advance. > > -Don > > Here’s a stripped down version of the code: > > JAVA: > > public class TestPage extends WebPage { > public TestPage() { > Form form = new Form("form"); > form.add(new AjaxSubmitLink("submit") { > @Override > protected void onSubmit(AjaxRequestTarget target, Form > form) { > super.onSubmit(target, form); > form.setVisible(false); > target.add(form); > } > }); > add(form.setOutputMarkupPlaceholderTag(true)); > } > } > > HTML: > http://www.w3.org/1999/xhtml"; xmlns:wicket=" > http://wicket.apache.org";> > > Test Form Submit Hides Form > > > Form Element > > > > > > EXCEPTION THROWN ON SUBMIT: > org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException: > Component rejected interface invocationComponent: [Form [Component id = > form]] Listener: [RequestListenerInterface name=IFormSubmitListener, > method=public abstract void > org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] > at > org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:212) > at > org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:241) > at > org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234) > … > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Wicket 7: Problem hiding form from AjaxSubmitLink
Dear Wicket Boffins, I have a Wicket 6 app that I’ve recently migrated to Wicket 7. In the app there is a form whose AjaxSubmitLink hides the form as part of the submit. In Wicket7, this causes a ListenerInvocationNotAllowedException to be thrown, since the component that submitted the form is no longer visible. What is the approved “wicket way” to do what I’m attempting? Thanks in advance. -Don Here’s a stripped down version of the code: JAVA: public class TestPage extends WebPage { public TestPage() { Form form = new Form("form"); form.add(new AjaxSubmitLink("submit") { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(target, form); form.setVisible(false); target.add(form); } }); add(form.setOutputMarkupPlaceholderTag(true)); } } HTML: http://www.w3.org/1999/xhtml"; xmlns:wicket="http://wicket.apache.org";> Test Form Submit Hides Form Form Element EXCEPTION THROWN ON SUBMIT: org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException: Component rejected interface invocationComponent: [Form [Component id = form]] Listener: [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:212) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:241) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234) … - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Multipart form doesn't work with AjaxSubmitLink (1.5.8 - 6.17 upgrade)
Hi, On Thu, Oct 30, 2014 at 11:52 AM, tomask79 wrote: > Hi Martin again, > > false alarm, I apologize. > No worries! The important thing is that it works ! > > As you mentioned, I debugged the wicket-ajax-jquery.js's > submitMultipartForm > function and found out that wicket was ending at the bold line: > > *wicket-ajax-jquery.js:* > . > . > if (form.onsubmit && !form.getAttribute(submittingAttribute)) { > form.setAttribute(submittingAttribute, submittingAttribute); > var retValue = true; > try { > retValue = form.onsubmit(); > } finally { > form.removeAttribute(submittingAttribute); > } > if (!retValue) { > *return; <= Here was wicket returning with form > unsubmitted* > This particular piece of code is in use in 1.5.x as well. > } > } > . > > All because my colleague* have rewritten the form's onsubmit attribute* > with > his code..:-) > I recommend you when you migrate to new version to not make improvements in your code. Just mark them for later, when the upgrade is finished. Otherwise it is hard to find whether the new version of the library is broken or your changes broke it. > Which disposed the code provided by wicket. > > Martin I apologize again, it's just that upgrade to 6.0 is a little > exhausting, because you changed a lot of things..:) > Migrating to 7.x should be much easier! There are no big refactorings and the migration guide <https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+7.0> is very detailed. > > regards > > Tomas. > > > > } > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Multipart-form-doesn-t-work-with-AjaxSubmitLink-1-5-8-6-17-upgrade-tp4668161p4668164.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: Multipart form doesn't work with AjaxSubmitLink (1.5.8 - 6.17 upgrade)
Hi Martin again, false alarm, I apologize. As you mentioned, I debugged the wicket-ajax-jquery.js's submitMultipartForm function and found out that wicket was ending at the bold line: *wicket-ajax-jquery.js:* . . if (form.onsubmit && !form.getAttribute(submittingAttribute)) { form.setAttribute(submittingAttribute, submittingAttribute); var retValue = true; try { retValue = form.onsubmit(); } finally { form.removeAttribute(submittingAttribute); } if (!retValue) { *return; <= Here was wicket returning with form unsubmitted* } } . All because my colleague* have rewritten the form's onsubmit attribute* with his code..:-) Which disposed the code provided by wicket. Martin I apologize again, it's just that upgrade to 6.0 is a little exhausting, because you changed a lot of things..:) regards Tomas. } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Multipart-form-doesn-t-work-with-AjaxSubmitLink-1-5-8-6-17-upgrade-tp4668161p4668164.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: Multipart form doesn't work with AjaxSubmitLink (1.5.8 - 6.17 upgrade)
Okay Martin, thanks for quick reply. I will try to simulate it as you said and let you know. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Multipart-form-doesn-t-work-with-AjaxSubmitLink-1-5-8-6-17-upgrade-tp4668161p4668163.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: Multipart form doesn't work with AjaxSubmitLink (1.5.8 - 6.17 upgrade)
Hi, Can you reproduce the problem in a quckstart ? If YES then please attach it to JIRA and we will take a look. You should go inside submitMultipartForm() with the debugger. When the form is multipart Wicket needs to use an iframe to make the submit. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Oct 30, 2014 at 10:42 AM, tomask79 wrote: > Hi guys, > > we're migrating to wicket 6.17 and I'm stuck at problem that > AjaxSubmitLinks > are not working inside form, which is marked as multipart form, yes we have > there some upload fields. Method onSubmit of AjaxSubmitLinks never gets > called...:-(...I see NO ERRORS in the javascript console...Anyway AjaxLinks > in the same place are working fineBack to problem: > > *HTML of AjaxSubmitLink* > > > > *Java* > > > > *Link inside DOM:* > > > > *Registered event in the new Wicket 6.0 style:* > > > Wicket.Ajax.ajax({"f":"form10e","mp":true,"u":"./application-form?3-3.IBehaviorListener.0-content-form-panesContainer-2-paneContent-panesContainer-0-paneContent-personsContainer-relatedPersons-2-remove&id=_AxmgvNX1d4A3Jiqlimy25exWY9xmL1U&tabId=a4UHLIwD5zvFwqfJ5Pw4","e":"click","c":"remove11d","sc":"panesContainer:2:paneContent:panesContainer:0:paneContent:personsContainer:relatedPersons:2:remove","m":"POST","i":"veil"});; > > > I was debugging wicket-ajax-jquery.js and jquery's ajax never get's called > in this case, because of the line: > > > > Repeated clicking at the mentioned AjaxSubmitLink ends then in message: > *"Channel '0' is busy - scheduling the callback to be executed when the > previous request finish."* in the AJAX DEBUG CONSOLE. > > > Guys, any help would be highly appreciated...Maybe I should refactor > mentioned form in some way, but migration guide doesn't provide info > concerning AjaxSubmitLink... > > Thank you very much in advance for any help > > regards > > Tomas > > > > > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Multipart-form-doesn-t-work-with-AjaxSubmitLink-1-5-8-6-17-upgrade-tp4668161.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 > >
Multipart form doesn't work with AjaxSubmitLink (1.5.8 - 6.17 upgrade)
Hi guys, we're migrating to wicket 6.17 and I'm stuck at problem that AjaxSubmitLinks are not working inside form, which is marked as multipart form, yes we have there some upload fields. Method onSubmit of AjaxSubmitLinks never gets called...:-(...I see NO ERRORS in the javascript console...Anyway AjaxLinks in the same place are working fineBack to problem: *HTML of AjaxSubmitLink* *Java* *Link inside DOM:* *Registered event in the new Wicket 6.0 style:* Wicket.Ajax.ajax({"f":"form10e","mp":true,"u":"./application-form?3-3.IBehaviorListener.0-content-form-panesContainer-2-paneContent-panesContainer-0-paneContent-personsContainer-relatedPersons-2-remove&id=_AxmgvNX1d4A3Jiqlimy25exWY9xmL1U&tabId=a4UHLIwD5zvFwqfJ5Pw4","e":"click","c":"remove11d","sc":"panesContainer:2:paneContent:panesContainer:0:paneContent:personsContainer:relatedPersons:2:remove","m":"POST","i":"veil"});; I was debugging wicket-ajax-jquery.js and jquery's ajax never get's called in this case, because of the line: Repeated clicking at the mentioned AjaxSubmitLink ends then in message: *"Channel '0' is busy - scheduling the callback to be executed when the previous request finish."* in the AJAX DEBUG CONSOLE. Guys, any help would be highly appreciated...Maybe I should refactor mentioned form in some way, but migration guide doesn't provide info concerning AjaxSubmitLink... Thank you very much in advance for any help regards Tomas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Multipart-form-doesn-t-work-with-AjaxSubmitLink-1-5-8-6-17-upgrade-tp4668161.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 not working when fileUpload in Form
Hello, Thank you for your feedback. So I took the example and started adding my code and it works ! After multiple comparisons and some tests I found out that the problem is in the HTML and arises when the is inside the tags. So no issue whatsoever having the submit in the form, unless there is a fileUpload. That's still a bit weird. But anyway, problem solved, so thanks again ! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-not-working-when-fileUpload-in-Form-tp4667740p4667766.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 not working when fileUpload in Form
Hi, The demo example at http://www.wicket-library.com/wicket-examples-6.0.x/ajax/upload seems to work fine. Take a look at its code (wicket-examples module) and see what is different with your code. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Sun, Sep 28, 2014 at 10:25 AM, cojy wrote: > Hi, > When I am having a fileUpload in a form, the wicket ajax debug throw the > following error: > > "An error occurred while executing Ajax request:TypeError: object is not a > function" > > and my ajaxsubmitlink actions onSubmit() or onError() are not called (so > nothing happens). > I am not sure if I am doing something wrong, if this is expected or if this > is a bug. > > Here is a simple code that I used: > > TestPage.java: > public final class TestPage extends PersistancePanel { > public TestPage(String id, Eventmgr em) { > super(id); > > Form form = new TestPage.TestPageForm("eventCreationForm", em); > form.setMultiPart(true); // Enable multipart mode (need for uploads > file) > form.setMaxSize(Bytes.kilobytes(128)); > form.setModel(new CompoundPropertyModel(em)); > add(form); > > } > > public final class TestPageForm extends Form { > public TestPageForm(final String id, Eventmgr eventMgr) { > super(id); > > add(new FileUploadField("fileUpload")); > > final WebMarkupContainer wmc2 = new WebMarkupContainer("wmc"); > wmc2.setOutputMarkupId(true); > > RefreshingView rv = new RefreshingView("subEventForm") { > @Override > //protected void populateItem(ListItem item) { > protected void populateItem(Item item) { > > > final Event event = (Event) item.getModelObject(); > > > item.add(new TextArea<>("descr2", new > PropertyModel(event, "descr"))); > } > > @Override > protected Iterator> getItemModels() { > return eventMgr.getILevents().iterator(); > } > > }; > rv.setItemReuseStrategy(new ReuseIfModelsEqualStrategy()); > wmc2.add(rv); > add(wmc2); > > AjaxSubmitLink addSubevent = new AjaxSubmitLink("addSubevent", > this) { > @Override > public void onSubmit(AjaxRequestTarget target, Form form) { > eventMgr.getEvents().add(new Event()); > System.out.println("OK"); > target.add(wmc2); > } > }; > addSubevent.setDefaultFormProcessing(false); > add(addSubevent); > } > @Override > protected void onSubmit() { > System.out.println("submit done"); > } > } > } > > TestPage.html > > > > CreateEvent > > > > > > > > > > > > key="event.addposter"/>: > > > > > > > > > > > > > : > cols="40"> > > > > > > + <#> > > > > > > > Thank you for your help, > Cojy. > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-not-working-when-fileUpload-in-Form-tp4667740.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 not working when fileUpload in Form
Hi, When I am having a fileUpload in a form, the wicket ajax debug throw the following error: "An error occurred while executing Ajax request:TypeError: object is not a function" and my ajaxsubmitlink actions onSubmit() or onError() are not called (so nothing happens). I am not sure if I am doing something wrong, if this is expected or if this is a bug. Here is a simple code that I used: TestPage.java: public final class TestPage extends PersistancePanel { public TestPage(String id, Eventmgr em) { super(id); Form form = new TestPage.TestPageForm("eventCreationForm", em); form.setMultiPart(true); // Enable multipart mode (need for uploads file) form.setMaxSize(Bytes.kilobytes(128)); form.setModel(new CompoundPropertyModel(em)); add(form); } public final class TestPageForm extends Form { public TestPageForm(final String id, Eventmgr eventMgr) { super(id); add(new FileUploadField("fileUpload")); final WebMarkupContainer wmc2 = new WebMarkupContainer("wmc"); wmc2.setOutputMarkupId(true); RefreshingView rv = new RefreshingView("subEventForm") { @Override //protected void populateItem(ListItem item) { protected void populateItem(Item item) { final Event event = (Event) item.getModelObject(); item.add(new TextArea<>("descr2", new PropertyModel(event, "descr"))); } @Override protected Iterator> getItemModels() { return eventMgr.getILevents().iterator(); } }; rv.setItemReuseStrategy(new ReuseIfModelsEqualStrategy()); wmc2.add(rv); add(wmc2); AjaxSubmitLink addSubevent = new AjaxSubmitLink("addSubevent", this) { @Override public void onSubmit(AjaxRequestTarget target, Form form) { eventMgr.getEvents().add(new Event()); System.out.println("OK"); target.add(wmc2); } }; addSubevent.setDefaultFormProcessing(false); add(addSubevent); } @Override protected void onSubmit() { System.out.println("submit done"); } } } TestPage.html CreateEvent : : + <#> Thank you for your help, Cojy. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-not-working-when-fileUpload-in-Form-tp4667740.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: Testing Form with AjaxSubmitLink
There is something similar already - org.apache.wicket.util.tester.FormTester#submitLink But it doesn't support Ajax at the moment. Feel free to send a PR (preferably with a test case) Martin Grigorov Wicket Training and Consulting On Thu, Mar 13, 2014 at 9:53 PM, Nick Pratt wrote: > Any reason that the FormTester.submit() couldn't be modified to check the > type of the form submitter, and invoke the correct code accordingly? > > N > > > On Thu, Mar 13, 2014 at 3:28 PM, Martin Grigorov >wrote: > > > Hi, > > > > See the javadoc of > > > org.apache.wicket.util.tester.BaseWicketTester#clickLink(java.lang.String, > > boolean) > > > > Martin Grigorov > > Wicket Training and Consulting > > > > > > On Thu, Mar 13, 2014 at 8:06 PM, Nick Pratt wrote: > > > > > How do you submit a form via WicketTester and an AjaxSubmitLink? > > > > > > > > > *HomePage.java:* > > > > > > public class HomePage extends WebPage > > > { > > > private static final long serialVersionUID = 1L; > > > > > > private String email; > > > > > > public HomePage( final PageParameters parameters ) > > > { > > > super( parameters ); > > > > > > Form form = new Form( "form" ); > > > add( form ); > > > > > > form.add( new EmailTextField( "email", new PropertyModel(this, > "email") ) > > > ); > > > form.add( new AjaxSubmitLink("submit") > > > { > > > @Override > > > protected void onSubmit( AjaxRequestTarget target, Form form ) > > > { > > > int i = 0; > > > } > > > }); > > > } > > > } > > > > > > *HomePage.html* > > > > > > > > > http://wicket.apache.org";> > > > > > > > > > > > > > > > Sign Up > > > > > > > > > > > > > > > > > > *Unit Test:* > > > > > > @Test > > > public void testPanel() throws Exception > > > { > > > WicketTester tester = new WicketTester(); > > > tester.startPage( HomePage.class ); > > > > > > FormTester formTester = tester.newFormTester( "form" ); > > > formTester.setValue( "email", "t...@test.com" ); > > > formTester.submit( "submit" ); > > > } > > > > > >
Re: Testing Form with AjaxSubmitLink
As Martin said you can use : tester.clickLink("form:submit", true); You can also use : tester.executeAjaxEvent("form:submit", "onclick"); Regards, Gabriel. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Testing-Form-with-AjaxSubmitLink-tp4664946p4664949.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: Testing Form with AjaxSubmitLink
Any reason that the FormTester.submit() couldn't be modified to check the type of the form submitter, and invoke the correct code accordingly? N On Thu, Mar 13, 2014 at 3:28 PM, Martin Grigorov wrote: > Hi, > > See the javadoc of > org.apache.wicket.util.tester.BaseWicketTester#clickLink(java.lang.String, > boolean) > > Martin Grigorov > Wicket Training and Consulting > > > On Thu, Mar 13, 2014 at 8:06 PM, Nick Pratt wrote: > > > How do you submit a form via WicketTester and an AjaxSubmitLink? > > > > > > *HomePage.java:* > > > > public class HomePage extends WebPage > > { > > private static final long serialVersionUID = 1L; > > > > private String email; > > > > public HomePage( final PageParameters parameters ) > > { > > super( parameters ); > > > > Form form = new Form( "form" ); > > add( form ); > > > > form.add( new EmailTextField( "email", new PropertyModel(this, "email") ) > > ); > > form.add( new AjaxSubmitLink("submit") > > { > > @Override > > protected void onSubmit( AjaxRequestTarget target, Form form ) > > { > > int i = 0; > > } > > }); > > } > > } > > > > *HomePage.html* > > > > > > http://wicket.apache.org";> > > > > > > > > > > Sign Up > > > > > > > > > > > > *Unit Test:* > > > > @Test > > public void testPanel() throws Exception > > { > > WicketTester tester = new WicketTester(); > > tester.startPage( HomePage.class ); > > > > FormTester formTester = tester.newFormTester( "form" ); > > formTester.setValue( "email", "t...@test.com" ); > > formTester.submit( "submit" ); > > } > > >
Re: Testing Form with AjaxSubmitLink
Hi, See the javadoc of org.apache.wicket.util.tester.BaseWicketTester#clickLink(java.lang.String, boolean) Martin Grigorov Wicket Training and Consulting On Thu, Mar 13, 2014 at 8:06 PM, Nick Pratt wrote: > How do you submit a form via WicketTester and an AjaxSubmitLink? > > > *HomePage.java:* > > public class HomePage extends WebPage > { > private static final long serialVersionUID = 1L; > > private String email; > > public HomePage( final PageParameters parameters ) > { > super( parameters ); > > Form form = new Form( "form" ); > add( form ); > > form.add( new EmailTextField( "email", new PropertyModel(this, "email") ) > ); > form.add( new AjaxSubmitLink("submit") > { > @Override > protected void onSubmit( AjaxRequestTarget target, Form form ) > { > int i = 0; > } > }); > } > } > > *HomePage.html* > > > http://wicket.apache.org";> > > > > > Sign Up > > > > > > *Unit Test:* > > @Test > public void testPanel() throws Exception > { > WicketTester tester = new WicketTester(); > tester.startPage( HomePage.class ); > > FormTester formTester = tester.newFormTester( "form" ); > formTester.setValue( "email", "t...@test.com" ); > formTester.submit( "submit" ); > } >
Testing Form with AjaxSubmitLink
How do you submit a form via WicketTester and an AjaxSubmitLink? *HomePage.java:* public class HomePage extends WebPage { private static final long serialVersionUID = 1L; private String email; public HomePage( final PageParameters parameters ) { super( parameters ); Form form = new Form( "form" ); add( form ); form.add( new EmailTextField( "email", new PropertyModel(this, "email") ) ); form.add( new AjaxSubmitLink("submit") { @Override protected void onSubmit( AjaxRequestTarget target, Form form ) { int i = 0; } }); } } *HomePage.html* http://wicket.apache.org";> Sign Up *Unit Test:* @Test public void testPanel() throws Exception { WicketTester tester = new WicketTester(); tester.startPage( HomePage.class ); FormTester formTester = tester.newFormTester( "form" ); formTester.setValue( "email", "t...@test.com" ); formTester.submit( "submit" ); }
Re: The AjaxSubmitLink does not respond after migrating to wicket 6
Did you have any luck with the migration? Im currently facing the same issue, none of my Ajax components seems to be working. Should we do any configuration changes? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/The-AjaxSubmitLink-does-not-respond-after-migrating-to-wicket-6-tp4664294p4664339.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: The AjaxSubmitLink does not respond after migrating to wicket 6
On Fri 07.02.2014 08:05, Heshani wrote: > > I fixed the registerPreCallHandler is not a function > error. But im still facing the issue where the AjaxSubmitLink > gets rendered with, href="javascript:;" That's OK. Since Wicket 6 this is done by event listeners. -Timo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: The AjaxSubmitLink does not respond after migrating to wicket 6
I fixed the registerPreCallHandler is not a function error. But im still facing the issue where the AjaxSubmitLink gets rendered with, href="javascript:;" -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/The-AjaxSubmitLink-does-not-respond-after-migrating-to-wicket-6-tp4664294p4664311.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: The AjaxSubmitLink does not respond after migrating to wicket 6
This API has been reworked. See https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax#WicketAjax-GlobalAjaxcalllisteners And http://wicketinaction.com/2012/07/wicket-6-javascript-improvements/ Martin Grigorov Wicket Training and Consulting On Fri, Feb 7, 2014 at 12:29 PM, Heshani wrote: > It does have the below javascript error, > Wicket.Ajax.registerPreCallHandler is not a function > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/The-AjaxSubmitLink-does-not-respond-after-migrating-to-wicket-6-tp4664294p4664296.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: The AjaxSubmitLink does not respond after migrating to wicket 6
It does have the below javascript error, Wicket.Ajax.registerPreCallHandler is not a function -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/The-AjaxSubmitLink-does-not-respond-after-migrating-to-wicket-6-tp4664294p4664296.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: The AjaxSubmitLink does not respond after migrating to wicket 6
Hi, Check for JavaScript errors/logs. Martin Grigorov Wicket Training and Consulting On Fri, Feb 7, 2014 at 12:15 PM, Heshani wrote: > I migrated the application from wicket 1.4 to 6.13.0. After the migration > the > AjaxSubmitLink gets rendered with, href="javascript:;". Anyone knows the > reason for this issue? > Thank you! > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/The-AjaxSubmitLink-does-not-respond-after-migrating-to-wicket-6-tp4664294.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 > >
The AjaxSubmitLink does not respond after migrating to wicket 6
I migrated the application from wicket 1.4 to 6.13.0. After the migration the AjaxSubmitLink gets rendered with, href="javascript:;". Anyone knows the reason for this issue? Thank you! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/The-AjaxSubmitLink-does-not-respond-after-migrating-to-wicket-6-tp4664294.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: Possible asynchronous ajax operations with form ajaxsubmitlink
Berlin, By "serialize" Sven meant that Wicket will execute them one by one. Do not confuse this with Java Object serialization. On Fri, Sep 13, 2013 at 11:27 PM, Sven Meier wrote: > See PageAccessSynchronizer > > Sven > > > On 09/13/2013 10:19 PM, Brown, Berlin [PRI-1PP] wrote: > >> I don't know how the page serialization matters. But I just did a test >> case and a user can submit ajax requests to wicket asynchronously but >> the requests are processed as part of a queue and the processing is >> synchronous. >> >> Is that mechanism handled in Java side/server side? What classes? >> >> -Original Message- >> From: Sven Meier [mailto:s...@meiers.net] >> Sent: Thursday, September 12, 2013 9:29 AM >> To: users@wicket.apache.org >> Subject: Re: Possible asynchronous ajax operations with form >> ajaxsubmitlink >> >> No, because all access to Wicket pages is serialized (on the server). >> >> Sven >> >> On 09/12/2013 03:20 PM, Brown, Berlin [PRI-1PP] wrote: >> >>> Is it possible for wicket to execute operations asynchronously in >>> terms of handling ajax calls. >>> >>> >>> For example, if I have an ajax submit link. >>> >>> >>> AjaxSubmitLink1 { >>> >>> OnSubmit() { >>> >>> runLongRunningOperation(); >>> >>> // Imagine this operation runs 10 seconds >>> >>> } >>> >>> } >>> >>> AjaxSubmitLink2 { >>> >>> OnSubmit() { >>> >>> runLongRunningOperation(); >>> >>> // Imagine this operation runs 2 seconds >>> >>> } >>> >>> } >>> >>> >>> Let's say a user clicks on ajaxsubmitlink1 and then ajaxsubmitlink2. >>> >>> (1)Runs in 10 seconds. >>> >>> (2)Runs in 5 seconds. >>> >>> >>> Is it possible that ajax submit link2 will complete before >>> ajaxsubmitlink1 even though the user click on 1 first? >>> >>> >>> >>> >> --**--**- >> To unsubscribe, e-mail: >> users-unsubscribe@wicket.**apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> >> >> --**--**- >> To unsubscribe, e-mail: >> users-unsubscribe@wicket.**apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > --**--**- > To unsubscribe, e-mail: > users-unsubscribe@wicket.**apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
RE: Possible asynchronous ajax operations with form ajaxsubmitlink
I don't know how the page serialization matters. But I just did a test case and a user can submit ajax requests to wicket asynchronously but the requests are processed as part of a queue and the processing is synchronous. Is that mechanism handled in Java side/server side? What classes? -Original Message- From: Sven Meier [mailto:s...@meiers.net] Sent: Thursday, September 12, 2013 9:29 AM To: users@wicket.apache.org Subject: Re: Possible asynchronous ajax operations with form ajaxsubmitlink No, because all access to Wicket pages is serialized (on the server). Sven On 09/12/2013 03:20 PM, Brown, Berlin [PRI-1PP] wrote: > Is it possible for wicket to execute operations asynchronously in > terms of handling ajax calls. > > > > For example, if I have an ajax submit link. > > > > AjaxSubmitLink1 { > > OnSubmit() { > > runLongRunningOperation(); > > // Imagine this operation runs 10 seconds > >} > > } > > AjaxSubmitLink2 { > > OnSubmit() { > > runLongRunningOperation(); > > // Imagine this operation runs 2 seconds > >} > > } > > > > Let's say a user clicks on ajaxsubmitlink1 and then ajaxsubmitlink2. > > (1)Runs in 10 seconds. > > (2)Runs in 5 seconds. > > > > Is it possible that ajax submit link2 will complete before > ajaxsubmitlink1 even though the user click on 1 first? > > > > - 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: Possible asynchronous ajax operations with form ajaxsubmitlink
See PageAccessSynchronizer Sven On 09/13/2013 10:19 PM, Brown, Berlin [PRI-1PP] wrote: I don't know how the page serialization matters. But I just did a test case and a user can submit ajax requests to wicket asynchronously but the requests are processed as part of a queue and the processing is synchronous. Is that mechanism handled in Java side/server side? What classes? -Original Message- From: Sven Meier [mailto:s...@meiers.net] Sent: Thursday, September 12, 2013 9:29 AM To: users@wicket.apache.org Subject: Re: Possible asynchronous ajax operations with form ajaxsubmitlink No, because all access to Wicket pages is serialized (on the server). Sven On 09/12/2013 03:20 PM, Brown, Berlin [PRI-1PP] wrote: Is it possible for wicket to execute operations asynchronously in terms of handling ajax calls. For example, if I have an ajax submit link. AjaxSubmitLink1 { OnSubmit() { runLongRunningOperation(); // Imagine this operation runs 10 seconds } } AjaxSubmitLink2 { OnSubmit() { runLongRunningOperation(); // Imagine this operation runs 2 seconds } } Let's say a user clicks on ajaxsubmitlink1 and then ajaxsubmitlink2. (1)Runs in 10 seconds. (2)Runs in 5 seconds. Is it possible that ajax submit link2 will complete before ajaxsubmitlink1 even though the user click on 1 first? - 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
Re: Possible asynchronous ajax operations with form ajaxsubmitlink
No, because all access to Wicket pages is serialized (on the server). Sven On 09/12/2013 03:20 PM, Brown, Berlin [PRI-1PP] wrote: Is it possible for wicket to execute operations asynchronously in terms of handling ajax calls. For example, if I have an ajax submit link. AjaxSubmitLink1 { OnSubmit() { runLongRunningOperation(); // Imagine this operation runs 10 seconds } } AjaxSubmitLink2 { OnSubmit() { runLongRunningOperation(); // Imagine this operation runs 2 seconds } } Let's say a user clicks on ajaxsubmitlink1 and then ajaxsubmitlink2. (1)Runs in 10 seconds. (2)Runs in 5 seconds. Is it possible that ajax submit link2 will complete before ajaxsubmitlink1 even though the user click on 1 first? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Possible asynchronous ajax operations with form ajaxsubmitlink
Is it possible for wicket to execute operations asynchronously in terms of handling ajax calls. For example, if I have an ajax submit link. AjaxSubmitLink1 { OnSubmit() { runLongRunningOperation(); // Imagine this operation runs 10 seconds } } AjaxSubmitLink2 { OnSubmit() { runLongRunningOperation(); // Imagine this operation runs 2 seconds } } Let's say a user clicks on ajaxsubmitlink1 and then ajaxsubmitlink2. (1)Runs in 10 seconds. (2)Runs in 5 seconds. Is it possible that ajax submit link2 will complete before ajaxsubmitlink1 even though the user click on 1 first?
Re: AjaxSubmitLink and AjaxRequestTarget.appendJavaScript
Hi, On Tue, Aug 27, 2013 at 5:21 PM, podmak wrote: > hi, > I need add some js in my AjaxSubmitLink.onSubmit(AjaxRequestTarget target, > Form form) but it is not working. example on my onSubmit function: > @Override > protected void onSubmit (AjaxRequestTarget target, Form form) > { > super.onSubmit(target, form); > target.appendJavaScript("myJS"); > } > > Is appendJavaScript working only in AjaxLink or? > No. It should work in this case too. Check the http response body with Firebug or similar tool. > > thanks > > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-and-AjaxRequestTarget-appendJavaScript-tp4661101.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 and AjaxRequestTarget.appendJavaScript
hi, I need add some js in my AjaxSubmitLink.onSubmit(AjaxRequestTarget target, Form form) but it is not working. example on my onSubmit function: @Override protected void onSubmit (AjaxRequestTarget target, Form form) { super.onSubmit(target, form); target.appendJavaScript("myJS"); } Is appendJavaScript working only in AjaxLink or? thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-and-AjaxRequestTarget-appendJavaScript-tp4661101.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 Errors
Hi, The AjaxSubmitLink just submits the data. Its #onError() is called when any of the submitted *form components* has an error. On Fri, Jun 21, 2013 at 7:39 PM, Richard W. Adams wrote: > When AjaxSubmitLink.onError() is called, how does one determine what the > error was? Calling getFeedbackMessage() (tried on both the link & on the > form) is returning null, & I can't see any other way to determine what > the error was... > > ** > > This email and any attachments may contain information that is > confidential and/or privileged for the sole use of the intended recipient. > Any use, review, disclosure, copying, distribution or reliance by others, > and any forwarding of this email or its contents, without the express > permission of the sender is strictly prohibited by law. If you are not the > intended recipient, please contact the sender immediately, delete the > e-mail and destroy all copies. > ** >
AjaxSubmitLink Errors
When AjaxSubmitLink.onError() is called, how does one determine what the error was? Calling getFeedbackMessage() (tried on both the link & on the form) is returning null, & I can't see any other way to determine what the error was... ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: Issue in 6.8.0 - Form with CompoundPropertyModel and AjaxSubmitLink
Hi, after fighting with registration AjaxCallListener to AjaxSubmitLink it works fine now. :-) Thanks Petr Dne 23.5.2013 13:13, Martin Grigorov napsal(a): Hi, Just re-read your previous message. I see now: $submitBtn.click(function(e) {... So you have two listeners on 'click' event on this button. Depending on which one is executed first the data will be send or not. By moving this logic in onAfter() handler you can be sure that the data is already sent when you disable the fields. On Thu, May 23, 2013 at 1:58 PM, Petr Zajac wrote: Hi, the JS is registered in @Override public void renderHead(IHeaderResponse response) { ClientSettings settings = new ClientSettings(getMarkupId()); response.render(**OnDomReadyHeaderItem.**forScript("new IJC.LoginForm(" + settings.toJson() + ");")); } of panel with the form. I'll try to do it like you proposed it. Thanks Petr Dne 23.5.2013 9:05, Martin Grigorov napsal(a): Hi Petr, How do you register this JS execution ? You should do it in AjaxCallListener#afterHandler because if you do it earlier then form submit wont sent the values for disabled fields. On Thu, May 23, 2013 at 12:39 AM, Petr Zajac wrote: Hi Martin, thanks for the quick answer. Yes, the text fields are not empty and the parameters in requests are also empty. I found why after small investigation. The text fields are disabled after pressing submit button by using jquery in our code: $form.find('input[type="text"]').add($form.find('input[**type=** "password"]')).attr('disabled', true); It looks like it's pretty danger to manipulate with input elements after submit. Have I report this issue? registration: var $form = $('form'); var $submitBtn = $form.find('input[type="submit"]'); if (!IJC.Utils.isDefined($submitBtn.data("ui-button"))) { $submitBtn.button({ icons: { primary: "ui-icon-gear", secondary: "ui-icon-triangle-1-s" } }); } $submitBtn.click(function(e) { $submitBtn.button("option", "label", "Connecting.." ); $submitBtn.button("option", "icons", { primary : "ui-icon-clock" }); $submitBtn.button("refresh"); $submitBtn.button("disable"); // $form.find('input[type="text"]').add($form.find('input[**type=** "password"]')).attr('disabled', true); }); Petr Dne 22.5.2013 22:18, Martin Grigorov napsal(a): Hi, On Wed, May 22, 2013 at 11:07 PM, Petr Zajac wrote: Hi, when I tried to upgrade to to Wicket 6.8.0 I found probably serious issue. We have Form with two text fields ('username' and 'password'). We set CompoundPropertyModel and bound properties to two textfields. The submit button uses AjaxSubmitLink. When I click to submit button the the form shows feedback that 'username' and 'password' fields cannot be empty. It works fine in 6.6.0 and 6.7.0 versions. Form implementation: form = new Form(ID_LOGIN_**FORM) { private static final long serialVersionUID = 1L; private String username; private String password; @Override protected void onInitialize() { super.onInitialize(); setDefaultModel(new CompoundPropertyModel>(this)); usernameTF = new RequiredTextField(ID_* *USERNAME); RequiredTextField => cannot be empty usernameTF.setOutputMarkupId(**true); usernameTF.add(new DefaultFocusBehavior()); add(usernameTF); add(new PasswordTextField(ID_PASSWORD)**); PasswordTextField also has setRequired(true); Its javadoc states this. Do you enter data in these fields ? If YES, then check whether it is being sent to the server (Dev Tools, Firebug). If you cannot find the issue then please put this code in a quickstart app and attach it to a ticket in Jira. add(new AjaxSubmitLink(ID_SUBMIT_LINK, this) { /** */ private static final long serialVersionUID = 1L; @Override protected void onSubmit(AjaxRequestTarget target, Form form) { // process input } @Override protected void onError(AjaxRequestTarget target, Form form) { // Method is invoked only if the input is invalid target.add(getPage()); } });
Re: Issue in 6.8.0 - Form with CompoundPropertyModel and AjaxSubmitLink
Hi, Just re-read your previous message. I see now: $submitBtn.click(function(e) {... So you have two listeners on 'click' event on this button. Depending on which one is executed first the data will be send or not. By moving this logic in onAfter() handler you can be sure that the data is already sent when you disable the fields. On Thu, May 23, 2013 at 1:58 PM, Petr Zajac wrote: > Hi, > the JS is registered in > @Override > public void renderHead(IHeaderResponse response) { > ClientSettings settings = new ClientSettings(getMarkupId()); > response.render(**OnDomReadyHeaderItem.**forScript("new > IJC.LoginForm(" + settings.toJson() + ");")); > } > > of panel with the form. > > I'll try to do it like you proposed it. > > Thanks > Petr > > Dne 23.5.2013 9:05, Martin Grigorov napsal(a): > >> Hi Petr, >> >> How do you register this JS execution ? >> You should do it in AjaxCallListener#afterHandler because if you do it >> earlier then form submit wont sent the values for disabled fields. >> >> >> On Thu, May 23, 2013 at 12:39 AM, Petr Zajac >> wrote: >> >> Hi Martin, >>> thanks for the quick answer. Yes, the text fields are not empty and the >>> parameters in requests are also empty. I found why after small >>> investigation. The text fields are disabled after pressing submit button >>> by >>> using jquery in our code: >>> >>> $form.find('input[type="text"]').add($form.find('input[**type=** >>> "password"]')).attr('disabled', true); >>> >>> >>> It looks like it's pretty danger to manipulate with input elements after >>> submit. Have I report this issue? >>> >>> registration: >>> >>> var $form = $('form'); >>> var $submitBtn = $form.find('input[type="submit"]'); >>> if (!IJC.Utils.isDefined($submitBtn.data("ui-button"))) { >>> >>> $submitBtn.button({ icons: { primary: "ui-icon-gear", >>> secondary: "ui-icon-triangle-1-s" } }); >>> } >>> $submitBtn.click(function(e) { >>> $submitBtn.button("option", "label", "Connecting.." ); >>> $submitBtn.button("option", "icons", { >>> primary : "ui-icon-clock" >>> }); >>> $submitBtn.button("refresh"); >>> $submitBtn.button("disable"); >>> // $form.find('input[type="text"]').add($form.find('input[**type=** >>> "password"]')).attr('disabled', true); >>> >>> }); >>> >>> >>> Petr >>> >>> Dne 22.5.2013 22:18, Martin Grigorov napsal(a): >>> >>> Hi, >>>> >>>> >>>> On Wed, May 22, 2013 at 11:07 PM, Petr Zajac >>>> wrote: >>>> >>>> Hi, >>>> >>>>> when I tried to upgrade to to Wicket 6.8.0 I found probably serious >>>>> issue. >>>>> We have Form with two text fields ('username' and 'password'). >>>>> We set CompoundPropertyModel and bound properties to two textfields. >>>>> The >>>>> submit button uses AjaxSubmitLink. When I click to submit button the >>>>> the >>>>> form shows feedback that 'username' and 'password' fields cannot be >>>>> empty. >>>>> It works fine in 6.6.0 and 6.7.0 versions. >>>>> >>>>> Form implementation: >>>>> >>>>> form = new Form(ID_LOGIN_**FORM) { >>>>> >>>>> >>>>> private static final long serialVersionUID = 1L; >>>>> private String username; >>>>> private String password; >>>>> @Override >>>>> protected void onInitialize() { >>>>> super.onInitialize(); >>>>> setDefaultModel(new CompoundPropertyModel>>>> LoginFormPanel>>(this)); >>>>> usernameTF = new RequiredTextField(ID_* >>>>> >>>>> *USERNAME); >>>>> >>>>&g
Re: Issue in 6.8.0 - Form with CompoundPropertyModel and AjaxSubmitLink
Hi, the JS is registered in @Override public void renderHead(IHeaderResponse response) { ClientSettings settings = new ClientSettings(getMarkupId()); response.render(OnDomReadyHeaderItem.forScript("new IJC.LoginForm(" + settings.toJson() + ");")); } of panel with the form. I'll try to do it like you proposed it. Thanks Petr Dne 23.5.2013 9:05, Martin Grigorov napsal(a): Hi Petr, How do you register this JS execution ? You should do it in AjaxCallListener#afterHandler because if you do it earlier then form submit wont sent the values for disabled fields. On Thu, May 23, 2013 at 12:39 AM, Petr Zajac wrote: Hi Martin, thanks for the quick answer. Yes, the text fields are not empty and the parameters in requests are also empty. I found why after small investigation. The text fields are disabled after pressing submit button by using jquery in our code: $form.find('input[type="text"]**').add($form.find('input[type=** "password"]')).attr('disabled'**, true); It looks like it's pretty danger to manipulate with input elements after submit. Have I report this issue? registration: var $form = $('form'); var $submitBtn = $form.find('input[type="**submit"]'); if (!IJC.Utils.isDefined($**submitBtn.data("ui-button"))) { $submitBtn.button({ icons: { primary: "ui-icon-gear", secondary: "ui-icon-triangle-1-s" } }); } $submitBtn.click(function(e) { $submitBtn.button("option", "label", "Connecting.." ); $submitBtn.button("option", "icons", { primary : "ui-icon-clock" }); $submitBtn.button("refresh"); $submitBtn.button("disable"); // $form.find('input[type="text"]**').add($form.find('input[type=** "password"]')).attr('disabled'**, true); }); Petr Dne 22.5.2013 22:18, Martin Grigorov napsal(a): Hi, On Wed, May 22, 2013 at 11:07 PM, Petr Zajac wrote: Hi, when I tried to upgrade to to Wicket 6.8.0 I found probably serious issue. We have Form with two text fields ('username' and 'password'). We set CompoundPropertyModel and bound properties to two textfields. The submit button uses AjaxSubmitLink. When I click to submit button the the form shows feedback that 'username' and 'password' fields cannot be empty. It works fine in 6.6.0 and 6.7.0 versions. Form implementation: form = new Form(ID_LOGIN_FORM) { private static final long serialVersionUID = 1L; private String username; private String password; @Override protected void onInitialize() { super.onInitialize(); setDefaultModel(new CompoundPropertyModel>(this)); usernameTF = new RequiredTextField(ID_*** *USERNAME); RequiredTextField => cannot be empty usernameTF.setOutputMarkupId(true); usernameTF.add(new DefaultFocusBehavior()); add(usernameTF); add(new PasswordTextField(ID_PASSWORD)); PasswordTextField also has setRequired(true); Its javadoc states this. Do you enter data in these fields ? If YES, then check whether it is being sent to the server (Dev Tools, Firebug). If you cannot find the issue then please put this code in a quickstart app and attach it to a ticket in Jira. add(new AjaxSubmitLink(ID_SUBMIT_LINK, this) { /** */ private static final long serialVersionUID = 1L; @Override protected void onSubmit(AjaxRequestTarget target, Form form) { // process input } @Override protected void onError(AjaxRequestTarget target, Form form) { // Method is invoked only if the input is invalid target.add(getPage()); } }); } Html of the form: Petr --** --**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.org<http://apache.org> For additional commands, e-mail: users-h...@wicket.apache.org --**--**- To unsubscribe, e-mail: users-unsubscribe@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: Issue in 6.8.0 - Form with CompoundPropertyModel and AjaxSubmitLink
Hi Petr, How do you register this JS execution ? You should do it in AjaxCallListener#afterHandler because if you do it earlier then form submit wont sent the values for disabled fields. On Thu, May 23, 2013 at 12:39 AM, Petr Zajac wrote: > Hi Martin, > thanks for the quick answer. Yes, the text fields are not empty and the > parameters in requests are also empty. I found why after small > investigation. The text fields are disabled after pressing submit button by > using jquery in our code: > > $form.find('input[type="text"]**').add($form.find('input[type=** > "password"]')).attr('disabled'**, true); > > It looks like it's pretty danger to manipulate with input elements after > submit. Have I report this issue? > > registration: > >var $form = $('form'); > var $submitBtn = $form.find('input[type="**submit"]'); > if (!IJC.Utils.isDefined($**submitBtn.data("ui-button"))) { > $submitBtn.button({ icons: { primary: "ui-icon-gear", > secondary: "ui-icon-triangle-1-s" } }); > } > $submitBtn.click(function(e) { > $submitBtn.button("option", "label", "Connecting.." ); > $submitBtn.button("option", "icons", { > primary : "ui-icon-clock" > }); > $submitBtn.button("refresh"); > $submitBtn.button("disable"); > // $form.find('input[type="text"]**').add($form.find('input[type=** > "password"]')).attr('disabled'**, true); > }); > > > Petr > > Dne 22.5.2013 22:18, Martin Grigorov napsal(a): > >> Hi, >> >> >> On Wed, May 22, 2013 at 11:07 PM, Petr Zajac >> wrote: >> >> Hi, >>> when I tried to upgrade to to Wicket 6.8.0 I found probably serious >>> issue. >>> We have Form with two text fields ('username' and 'password'). >>> We set CompoundPropertyModel and bound properties to two textfields. The >>> submit button uses AjaxSubmitLink. When I click to submit button the the >>> form shows feedback that 'username' and 'password' fields cannot be >>> empty. >>> It works fine in 6.6.0 and 6.7.0 versions. >>> >>> Form implementation: >>> >>> form = new Form(ID_LOGIN_FORM) { >>> >>> private static final long serialVersionUID = 1L; >>> private String username; >>> private String password; >>> @Override >>> protected void onInitialize() { >>> super.onInitialize(); >>> setDefaultModel(new CompoundPropertyModel>> LoginFormPanel>>(this)); >>> usernameTF = new RequiredTextField(ID_*** >>> *USERNAME); >>> >>> RequiredTextField => cannot be empty >> >> >> usernameTF.setOutputMarkupId(true); >>> usernameTF.add(new DefaultFocusBehavior()); >>> >>> add(usernameTF); >>> add(new PasswordTextField(ID_PASSWORD)); >>> >>> PasswordTextField also has setRequired(true); >> Its javadoc states this. >> >> >> >> Do you enter data in these fields ? >> If YES, then check whether it is being sent to the server (Dev Tools, >> Firebug). >> If you cannot find the issue then please put this code in a quickstart app >> and attach it to a ticket in Jira. >> >> >> add(new AjaxSubmitLink(ID_SUBMIT_LINK, this) { >>> /** */ >>> private static final long serialVersionUID = 1L; >>> >>> @Override >>> protected void onSubmit(AjaxRequestTarget target, >>> Form form) { >>> // process input >>> } >>> >>> @Override >>> protected void onError(AjaxRequestTarget target, >>> Form form) { >>> // Method is invoked only if the input is >>> invalid >>> target.add(getPage()); >>> } >>> }); >>> } >>> >>> Html of the form: >>> >>> >> >>> /> >> wicket:id="username" /> >>> >> key="LoginFormPanel.lbPassword" /> >>> >>> >>> >>> >>> >> >>> class="ui-button-process" >>> wicket:id="submitLink" /> >>> >>> >>> >>> Petr >>> >>> --** >>> --**- >>> To unsubscribe, e-mail: >>> users-unsubscribe@wicket.**apa**che.org<http://apache.org> >>> >>> > >>> >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >>> > > --**--**- > To unsubscribe, e-mail: > users-unsubscribe@wicket.**apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Issue in 6.8.0 - Form with CompoundPropertyModel and AjaxSubmitLink
Hi Martin, thanks for the quick answer. Yes, the text fields are not empty and the parameters in requests are also empty. I found why after small investigation. The text fields are disabled after pressing submit button by using jquery in our code: $form.find('input[type="text"]').add($form.find('input[type="password"]')).attr('disabled', true); It looks like it's pretty danger to manipulate with input elements after submit. Have I report this issue? registration: var $form = $('form'); var $submitBtn = $form.find('input[type="submit"]'); if (!IJC.Utils.isDefined($submitBtn.data("ui-button"))) { $submitBtn.button({ icons: { primary: "ui-icon-gear", secondary: "ui-icon-triangle-1-s" } }); } $submitBtn.click(function(e) { $submitBtn.button("option", "label", "Connecting.." ); $submitBtn.button("option", "icons", { primary : "ui-icon-clock" }); $submitBtn.button("refresh"); $submitBtn.button("disable"); // $form.find('input[type="text"]').add($form.find('input[type="password"]')).attr('disabled', true); }); Petr Dne 22.5.2013 22:18, Martin Grigorov napsal(a): Hi, On Wed, May 22, 2013 at 11:07 PM, Petr Zajac wrote: Hi, when I tried to upgrade to to Wicket 6.8.0 I found probably serious issue. We have Form with two text fields ('username' and 'password'). We set CompoundPropertyModel and bound properties to two textfields. The submit button uses AjaxSubmitLink. When I click to submit button the the form shows feedback that 'username' and 'password' fields cannot be empty. It works fine in 6.6.0 and 6.7.0 versions. Form implementation: form = new Form(ID_LOGIN_**FORM) { private static final long serialVersionUID = 1L; private String username; private String password; @Override protected void onInitialize() { super.onInitialize(); setDefaultModel(new CompoundPropertyModel>(this)); usernameTF = new RequiredTextField(ID_**USERNAME); RequiredTextField => cannot be empty usernameTF.setOutputMarkupId(**true); usernameTF.add(new DefaultFocusBehavior()); add(usernameTF); add(new PasswordTextField(ID_PASSWORD)**); PasswordTextField also has setRequired(true); Its javadoc states this. Do you enter data in these fields ? If YES, then check whether it is being sent to the server (Dev Tools, Firebug). If you cannot find the issue then please put this code in a quickstart app and attach it to a ticket in Jira. add(new AjaxSubmitLink(ID_SUBMIT_LINK, this) { /** */ private static final long serialVersionUID = 1L; @Override protected void onSubmit(AjaxRequestTarget target, Form form) { // process input } @Override protected void onError(AjaxRequestTarget target, Form form) { // Method is invoked only if the input is invalid target.add(getPage()); } }); } Html of the form: Petr --**--**- To unsubscribe, e-mail: users-unsubscribe@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: Issue in 6.8.0 - Form with CompoundPropertyModel and AjaxSubmitLink
Hi, On Wed, May 22, 2013 at 11:07 PM, Petr Zajac wrote: > Hi, > when I tried to upgrade to to Wicket 6.8.0 I found probably serious issue. > We have Form with two text fields ('username' and 'password'). > We set CompoundPropertyModel and bound properties to two textfields. The > submit button uses AjaxSubmitLink. When I click to submit button the the > form shows feedback that 'username' and 'password' fields cannot be empty. > It works fine in 6.6.0 and 6.7.0 versions. > > Form implementation: > > form = new Form(ID_LOGIN_**FORM) { > private static final long serialVersionUID = 1L; > private String username; > private String password; > @Override > protected void onInitialize() { > super.onInitialize(); > setDefaultModel(new CompoundPropertyModel LoginFormPanel>>(this)); > usernameTF = new RequiredTextField(ID_**USERNAME); > RequiredTextField => cannot be empty > usernameTF.setOutputMarkupId(**true); > usernameTF.add(new DefaultFocusBehavior()); > > add(usernameTF); > add(new PasswordTextField(ID_PASSWORD)**); > PasswordTextField also has setRequired(true); Its javadoc states this. Do you enter data in these fields ? If YES, then check whether it is being sent to the server (Dev Tools, Firebug). If you cannot find the issue then please put this code in a quickstart app and attach it to a ticket in Jira. > add(new AjaxSubmitLink(ID_SUBMIT_LINK, this) { > /** */ > private static final long serialVersionUID = 1L; > > @Override > protected void onSubmit(AjaxRequestTarget target, > Form form) { > // process input > } > > @Override > protected void onError(AjaxRequestTarget target, > Form form) { > // Method is invoked only if the input is invalid > target.add(getPage()); > } > }); > } > > Html of the form: > > /> wicket:id="username" /> > key="LoginFormPanel.**lbPassword" /> > > > wicket:message="value:**LoginFormPanel.lbSubmit" > class="ui-button-process" > wicket:id="submitLink" /> > > > > Petr > > --**--**- > To unsubscribe, e-mail: > users-unsubscribe@wicket.**apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Issue in 6.8.0 - Form with CompoundPropertyModel and AjaxSubmitLink
Hi, when I tried to upgrade to to Wicket 6.8.0 I found probably serious issue. We have Form with two text fields ('username' and 'password'). We set CompoundPropertyModel and bound properties to two textfields. The submit button uses AjaxSubmitLink. When I click to submit button the the form shows feedback that 'username' and 'password' fields cannot be empty. It works fine in 6.6.0 and 6.7.0 versions. Form implementation: form = new Form(ID_LOGIN_FORM) { private static final long serialVersionUID = 1L; private String username; private String password; @Override protected void onInitialize() { super.onInitialize(); setDefaultModel(new CompoundPropertyModel>(this)); usernameTF = new RequiredTextField(ID_USERNAME); usernameTF.setOutputMarkupId(true); usernameTF.add(new DefaultFocusBehavior()); add(usernameTF); add(new PasswordTextField(ID_PASSWORD)); add(new AjaxSubmitLink(ID_SUBMIT_LINK, this) { /** */ private static final long serialVersionUID = 1L; @Override protected void onSubmit(AjaxRequestTarget target, Form form) { // process input } @Override protected void onError(AjaxRequestTarget target, Form form) { // Method is invoked only if the input is invalid target.add(getPage()); } }); } Html of the form: /> wicket:id="username" /> key="LoginFormPanel.lbPassword" /> wicket:message="value:LoginFormPanel.lbSubmit" class="ui-button-process" wicket:id="submitLink" /> Petr - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: setResponsePage in AjaxSubmitLink causing AjaxError
Hi Jeremy, redirects via ajax work fine here. See wicket-examples' LinksPage.java for an example. Sven On 04/16/2013 11:30 PM, Jeremy Levy wrote: I'm using Wicket 6.6.0, in an AjaxSubmitLink when I do a setResponsepage(myclass.class) or (throw new RedirectResponse) i get the following error in the wicket ajax debug console: *ERROR: * Wicket.Ajax.Call.failure: Error while parsing response: Error: Invalid XML: The error console also includes the full HTML of the destination page. Any idea whats going on here? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: setResponsePage in AjaxSubmitLink causing AjaxError
I figured it out- further up in the code I was calling: new PageReference(new PageProvider(MyPage.class).getInstance().getPageId()) which was causing the problem. Jeremy On Tue, Apr 16, 2013 at 5:30 PM, Jeremy Levy wrote: > I'm using Wicket 6.6.0, in an AjaxSubmitLink when I do a > setResponsepage(myclass.class) or (throw new RedirectResponse) i get the > following error in the wicket ajax debug console: > > *ERROR: * > Wicket.Ajax.Call.failure: Error while parsing response: Error: Invalid XML: > > > The error console also includes the full HTML of the destination page. > > Any idea whats going on here? > -- > Jeremy Levy > -- Jeremy Levy
setResponsePage in AjaxSubmitLink causing AjaxError
I'm using Wicket 6.6.0, in an AjaxSubmitLink when I do a setResponsepage(myclass.class) or (throw new RedirectResponse) i get the following error in the wicket ajax debug console: *ERROR: * Wicket.Ajax.Call.failure: Error while parsing response: Error: Invalid XML: The error console also includes the full HTML of the destination page. Any idea whats going on here? -- Jeremy Levy
Re: Wicket 1.4.x - AjaxSubmitLink doesn't work
Hi, On Thu, Mar 14, 2013 at 3:56 PM, anotherUser < juan.dellagn...@theiaconsulting.com> wrote: > Hi this my first post here, let's see my problem: > Welcome ! > i am adding a AjaxSubmitLink in a Listview like this: > > AjaxSubmitLink lnkAgregar = new AjaxSubmitLink("lnkDetalle", form) { > > @Override > protected void onSubmit(AjaxRequestTarget art, Form form) { > > } >}; > lnkAgregar.setMarkupId("LNKDETALLE_A_" + fDetalle.getId()); > > when i tried to click this link > Wicket Ajax Debug Windows show me: > NFO: Ajax POST stopped because of precondition check, > > url:?wicket:interface=:3:templateCircuitoFirmasForm:containerLW:lwTemplateFirmasDetalle:1:lnkAgregarDetalle::IActivePageBehaviorListener:0:-1&wicket:ignoreIfNotActive=true > > This was because, fDetalle.getId() was null, i comment this line and > resolve > the problem > lnkAgregar.setMarkupId("LNKDETALLE_A_" + fDetalle.getId()); > > And the question is, I guess, why ? A: Because Wicket makes a check that the HTML element that triggers the JS event and the form to be submitted are in the DOM document. I suppose there are several links with the same markup id - LNKDETALLE_A_null. > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Wicket-1-4-x-AjaxSubmitLink-doesn-t-work-tp4657243.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 <http://jweekend.com/>
Wicket 1.4.x - AjaxSubmitLink doesn't work
Hi this my first post here, let's see my problem: i am adding a AjaxSubmitLink in a Listview like this: AjaxSubmitLink lnkAgregar = new AjaxSubmitLink("lnkDetalle", form) { @Override protected void onSubmit(AjaxRequestTarget art, Form form) { } }; lnkAgregar.setMarkupId("LNKDETALLE_A_" + fDetalle.getId()); when i tried to click this link Wicket Ajax Debug Windows show me: NFO: Ajax POST stopped because of precondition check, url:?wicket:interface=:3:templateCircuitoFirmasForm:containerLW:lwTemplateFirmasDetalle:1:lnkAgregarDetalle::IActivePageBehaviorListener:0:-1&wicket:ignoreIfNotActive=true This was because, fDetalle.getId() was null, i comment this line and resolve the problem lnkAgregar.setMarkupId("LNKDETALLE_A_" + fDetalle.getId()); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-4-x-AjaxSubmitLink-doesn-t-work-tp4657243.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 + setResponsePage = feedback message problem on new page
Thx for this post, it also helped me :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-setResponsePage-feedback-message-problem-on-new-page-tp1843719p4654214.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: double click on AjaxSubmitLink and page expired
thanks Martin - I'll try the veil and report later -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/double-click-on-AjaxSubmitLink-and-page-expired-tp4449450p4453493.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: double click on AjaxSubmitLink and page expired
On Wed, Mar 7, 2012 at 4:53 PM, rebecca wrote: > I already tried removing the "reset" code - didn't work. Put some console.log() to see what happens in JS. > By veil you mean something like the jquery plugin blockUi? Yes > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/double-click-on-AjaxSubmitLink-and-page-expired-tp4449450p4453452.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: double click on AjaxSubmitLink and page expired
I already tried removing the "reset" code - didn't work. By veil you mean something like the jquery plugin blockUi? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/double-click-on-AjaxSubmitLink-and-page-expired-tp4449450p4453452.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: double click on AjaxSubmitLink and page expired
OK, then remove the 'reset' part of the AjaxCallDecorator. You don't need to re-enable the link at all. If you have more links on the page then you need to put a veil on the whole page, not just disable a single link. On Wed, Mar 7, 2012 at 4:33 PM, rebecca wrote: > in onSubmit of the AjaxSubmitLink i do: > > getSession.untouch(firstPage); > getSession.clear(); > setResponsePaeg(new myNextPage()); > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/double-click-on-AjaxSubmitLink-and-page-expired-tp4449450p4453399.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: double click on AjaxSubmitLink and page expired
in onSubmit of the AjaxSubmitLink i do: getSession.untouch(firstPage); getSession.clear(); setResponsePaeg(new myNextPage()); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/double-click-on-AjaxSubmitLink-and-page-expired-tp4449450p4453399.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: double click on AjaxSubmitLink and page expired
What exactly do you do in #onClick/onSubmit() ? I guess you set a new page as response, or at least remove all links which still point to the current page which is untouched and no more reachable. On Wed, Mar 7, 2012 at 3:26 PM, rebecca wrote: > I used exactly the one in Apache Wicket Cookbook: > > BlockingDecorator.java: > > public class BlockingDecorator implements IAjaxCallDecorator > { > private static final String latch="var > locked=this.hasAttribute('data-wicket-blocked');" + > "if (locked) { return false; }"+ > "this.setAttribute('data-wicket-blocked','data-wicket-blocked');"; > > private static final String > reset="this.removeAttribute('data-wicket-blocked');"; > > public CharSequence decorateScript(CharSequence script) { > return latch + script; > } > > public CharSequence decorateOnSuccessScript(CharSequence script) { > return reset + script; > } > public CharSequence decorateOnFailureScript(CharSequence script) { > return reset + script; > } > } > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/double-click-on-AjaxSubmitLink-and-page-expired-tp4449450p4453255.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: double click on AjaxSubmitLink and page expired
I used exactly the one in Apache Wicket Cookbook: BlockingDecorator.java: public class BlockingDecorator implements IAjaxCallDecorator { private static final String latch="var locked=this.hasAttribute('data-wicket-blocked');" + "if (locked) { return false; }"+ "this.setAttribute('data-wicket-blocked','data-wicket-blocked');"; private static final String reset="this.removeAttribute('data-wicket-blocked');"; public CharSequence decorateScript(CharSequence script) { return latch + script; } public CharSequence decorateOnSuccessScript(CharSequence script) { return reset + script; } public CharSequence decorateOnFailureScript(CharSequence script) { return reset + script; } } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/double-click-on-AjaxSubmitLink-and-page-expired-tp4449450p4453255.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: double click on AjaxSubmitLink and page expired
On Wed, Mar 7, 2012 at 2:41 PM, rebecca wrote: > hi again > > Can you help me with this? I'm really stuck with this problem... Show us your AjaxCallDecorator. > > thanks > Rebecca > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/double-click-on-AjaxSubmitLink-and-page-expired-tp4449450p4453153.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: double click on AjaxSubmitLink and page expired
hi again Can you help me with this? I'm really stuck with this problem... thanks Rebecca -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/double-click-on-AjaxSubmitLink-and-page-expired-tp4449450p4453153.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: double click on AjaxSubmitLink and page expired
hi Martin First, I understand that wicket internals fail, but why the javascript i added using AjaxCallDecorator (I used the example in the Apache Wicket Cookbook) to block the second submit - has no effect? I see the JS is added in the beginning of the onclick property of the button and is called before the request goes to the server, but i can still press the submit button right after the first click and it somehow arrives to the server again. Second, i use untouch() to remove the previous page from the session, in order to prevent the user from using the back button. Nothing else worked for me and i saw other similar posts in this forum, where other wicket users used the same hack. I'll be glad to use a better solution. thanks Rebecca -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/double-click-on-AjaxSubmitLink-and-page-expired-tp4449450p4449825.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: double click on AjaxSubmitLink and page expired
Hi, On Tue, Mar 6, 2012 at 1:26 PM, Josh Kamau wrote: > How about something as easy as checking if the session has been cleared > before calling set response page... > > e.g > > if(sessionNotClear...){ > session.clear(); > setResponsePage() > } Wicket internals fail because Wicket cannot find the Link to click, so it doesn't even get to the application code. @rebecca: I told you (few months ago) that this #untouch() doesn't look like a good idea. It is still not reintroduced in 1.5+ > > On Tue, Mar 6, 2012 at 2:16 PM, rebecca wrote: > >> sorry - i forgot - I'm using wicket 1.4.18 >> >> -- >> View this message in context: >> http://apache-wicket.1842946.n4.nabble.com/double-click-on-AjaxSubmitLink-and-page-expired-tp4449450p4449457.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: double click on AjaxSubmitLink and page expired
How about something as easy as checking if the session has been cleared before calling set response page... e.g if(sessionNotClear...){ session.clear(); setResponsePage() } On Tue, Mar 6, 2012 at 2:16 PM, rebecca wrote: > sorry - i forgot - I'm using wicket 1.4.18 > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/double-click-on-AjaxSubmitLink-and-page-expired-tp4449450p4449457.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: double click on AjaxSubmitLink and page expired
sorry - i forgot - I'm using wicket 1.4.18 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/double-click-on-AjaxSubmitLink-and-page-expired-tp4449450p4449457.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
double click on AjaxSubmitLink and page expired
Hello all, I have a page with a form and an AjaxSubmitLink on it. In the onSubmit() I do some business logic and redirect the user to the next page using setResponsePage(nextPage). Just before redirecting to the next page I do: getSession.untouch(firstPage); getSession.clear(); I do this in order to prevent the user from returning to this page. The problem is when the user clicks twice on the AjaxSubmitLink - the clear session logic get's called in the first click and then i get "page expired" in the second link. I tried to use AjaxCallDecorator to block the button in the second click, but still got the "page expired". Can you help me here? Am I trying to do something that is not possible? thanks Rebecca -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/double-click-on-AjaxSubmitLink-and-page-expired-tp4449450p4449450.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 : Simple attribute modifier (confirm javascript popup) never calld , form not submited
If understand your problem correctly, the solution might be just to create it as an AjaxButton & override the onSubmit & onError methods. We do that in our app & works great. "RAM /abr./: Rarely Adequate Memory." From: chimaira To: users@wicket.apache.org Date: 01/23/2012 05:53 PM Subject:AjaxSubmitLink : Simple attribute modifier (confirm javascript popup) never calld , form not submited Hello , sorry for my english ! I m facing a probleme with AjaxSubmitLink on a form compoenent I want to add a simple attribute modifier with a on click and a confirm javascript popup, to get to user confirmation befor submiting. That works fine with a simple wicket button , but I want to use AjaxSubmitLink that way I can overrid the OnError methode and refresh my form feedback, so I create I class AjaxConfirmButton extends AjaxSubmitLink. and in the constructor I add the behaviour (add( new SimpleAttributeModifier('onclick', "return confirm(...)"). the probleme is the on click javascript is never calld and the form is never submited. is there a way to fix this issue? hanks a lot -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4322492.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 ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Re: AjaxSubmitLink : Simple attribute modifier (confirm javascript popup) never calld , form not submited
I got it, Thanks for your help -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4323328.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 : Simple attribute modifier (confirm javascript popup) never calld , form not submited
new AjaxLink() { protected IAjaxCallDecorator getAjaxCallDecorator() {return new JSConfirmDecorator(); } } On Tue, Jan 24, 2012 at 11:04 AM, chimaira wrote: > Hi martin, > oops I thought the AjaxCallDecorator was a markup component, sorry > > So how can I implement it in my AjaxLink ? By simply adding it in my > constructor? > > > Thanks again > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4323255.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 : Simple attribute modifier (confirm javascript popup) never calld , form not submited
Hi martin, oops I thought the AjaxCallDecorator was a markup component, sorry So how can I implement it in my AjaxLink ? By simply adding it in my constructor? Thanks again -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4323255.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 : Simple attribute modifier (confirm javascript popup) never calld , form not submited
Hi, On Tue, Jan 24, 2012 at 10:27 AM, chimaira wrote: > Thanks Igor, But , how can I assign the markup Id ? There is no constructor > with a super(id) method ! Which markup id you need ? @Override public CharSequence decorateScript(Component c, CharSequence script){ return "if (!confirm('" + StringUtils.replace(confirmMessage, "'", "\'") + "')) return false;\n" + script; This is the code that generates the JavaScript. Here you receive the component (c), so you can use c.getMarkupId(), if this is the markup id you need. > > Thanks again > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4323167.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 : Simple attribute modifier (confirm javascript popup) never calld , form not submited
Thanks Igor, But , how can I assign the markup Id ? There is no constructor with a super(id) method ! Thanks again -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4323167.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 : Simple attribute modifier (confirm javascript popup) never calld , form not submited
for ajax links you need to use an IAjaxCallDecorator to tweak the javascript. below is a possible impl. -igor public class JavascriptConfirmDecorator extends AjaxCallDecorator { private final String confirmMessage; public JavascriptConfirmDecorator(String confirmMessage){ this.confirmMessage = confirmMessage; } @Override public CharSequence decorateScript(Component c, CharSequence script) { return "if (!confirm('" + StringUtils.replace(confirmMessage, "'", "\'") + "')) return false;\n" + script; } } On Mon, Jan 23, 2012 at 3:53 PM, chimaira wrote: > Hello , sorry for my english ! > > > I m facing a probleme with AjaxSubmitLink on a form compoenent > > I want to add a simple attribute modifier with a on click and a confirm > javascript popup, to get to user confirmation befor submiting. > > That works fine with a simple wicket button , but I want to use > AjaxSubmitLink that way I can overrid the OnError methode and refresh my > form feedback, so I create I class AjaxConfirmButton extends AjaxSubmitLink. > and in the constructor I add the behaviour (add( new > SimpleAttributeModifier('onclick', "return confirm(...)"). > > the probleme is the on click javascript is never calld and the form is never > submited. > > is there a way to fix this issue? > hanks a lot > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4322492.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 : Simple attribute modifier (confirm javascript popup) never calld , form not submited
Hello , sorry for my english ! I m facing a probleme with AjaxSubmitLink on a form compoenent I want to add a simple attribute modifier with a on click and a confirm javascript popup, to get to user confirmation befor submiting. That works fine with a simple wicket button , but I want to use AjaxSubmitLink that way I can overrid the OnError methode and refresh my form feedback, so I create I class AjaxConfirmButton extends AjaxSubmitLink. and in the constructor I add the behaviour (add( new SimpleAttributeModifier('onclick', "return confirm(...)"). the probleme is the on click javascript is never calld and the form is never submited. is there a way to fix this issue? hanks a lot -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4322492.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 1.4.18 issue/not working
On Mon, Sep 19, 2011 at 5:14 AM, Wayne W wrote: > The thing is I'm not doing anything special here, just straight wicket > form stuff AFAIK. > > Here is what is generated from wicket for the form and the link: > > action="../../?wicket:interface=:2:users:addPersonContainer:addPersonPanel:userForm::IFormSubmitListener::" > method="post"> The form id is different. Here is "userForm4e". Below is 'userForm1f' (wcall=wicketSubmitFormById('userForm1f' ) > ... > > > Add this person or > group > > > style="display:none"> src="../../images/icons/spinnerflat.gif"> > > > > As you may see we have an ajax call decorator as well. > > > > > > On Sat, Sep 17, 2011 at 3:59 AM, Igor Vaynberg > wrote: >> no. i thikn it should be >> >> if (typeof(retVal)=="undefined") retVal=true; >> >> -igor >> >> On Fri, Sep 16, 2011 at 10:58 AM, Martin Grigorov >> wrote: >>> return (typeOf retVal === "undefined" || retVal === true) >>> >>> in all other cases stop the submit >>> >>> looks OK ? >>> >>> On Fri, Sep 16, 2011 at 8:57 PM, Martin Grigorov >>> wrote: >>>> Yes, sounds like a good idea. >>>> What if the user code returns an object ? >>>> >>>> On Fri, Sep 16, 2011 at 6:11 PM, Igor Vaynberg >>>> wrote: >>>>> i think in this case we should define the undefined to be true... >>>>> >>>>> -igor >>>>> >>>>> On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov >>>>> wrote: >>>>>> it seems in your code you have without >>>>>> returning anything. Since 'if (undefined)' is 'false' the call stops >>>>>> there. >>>>>> >>>>>> On Fri, Sep 16, 2011 at 3:25 PM, Wayne W >>>>>> wrote: >>>>>>> and in what case does it not return anything? >>>>>>> >>>>>>> >>>>>>> On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov >>>>>>> wrote: >>>>>>>> It should return true or false. >>>>>>>> False if there is some reason to not submit the form, for example >>>>>>>> client side validation failed. >>>>>>>> True if everything is OK and the submit can proceed. >>>>>>>> >>>>>>>> On Fri, Sep 16, 2011 at 6:21 AM, Wayne W >>>>>>>> wrote: >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that >>>>>>>>> AjaxSubmitLink is not working (at least with one form). >>>>>>>>> >>>>>>>>> The form doesn't get submitted - the problem in wicket-ajax.js is >>>>>>>>> (~line 1120): >>>>>>>>> >>>>>>>>> // Submits a form using ajax. >>>>>>>>> // This method serializes a form and sends it as POST body. >>>>>>>>> submitForm: function(form, submitButton) { >>>>>>>>> var submittingAttribute = 'data-wicket-submitting'; >>>>>>>>> if (form.onsubmit && >>>>>>>>> !form.getAttribute(submittingAttribute)) { >>>>>>>>> form.setAttribute(submittingAttribute, >>>>>>>>> submittingAttribute); >>>>>>>>> var retValue = form.onsubmit(); >>>>>>>>> form.removeAttribute(submittingAttribute); >>>>>>>>> if (!retValue) return; >>>>>>>>> } >>>>>>>>> >>>>>>>>> >>>>>>>>> The problem is var retValue = form.onsubmit(); does not return any >>>>>>>>> value (retValue remains undefined) and hence it returns and doesn't do >>>>>>>>> the submit. I don
Re: AjaxSubmitLink 1.4.18 issue/not working
The thing is I'm not doing anything special here, just straight wicket form stuff AFAIK. Here is what is generated from wicket for the form and the link: ... Add this person or group As you may see we have an ajax call decorator as well. On Sat, Sep 17, 2011 at 3:59 AM, Igor Vaynberg wrote: > no. i thikn it should be > > if (typeof(retVal)=="undefined") retVal=true; > > -igor > > On Fri, Sep 16, 2011 at 10:58 AM, Martin Grigorov > wrote: >> return (typeOf retVal === "undefined" || retVal === true) >> >> in all other cases stop the submit >> >> looks OK ? >> >> On Fri, Sep 16, 2011 at 8:57 PM, Martin Grigorov >> wrote: >>> Yes, sounds like a good idea. >>> What if the user code returns an object ? >>> >>> On Fri, Sep 16, 2011 at 6:11 PM, Igor Vaynberg >>> wrote: >>>> i think in this case we should define the undefined to be true... >>>> >>>> -igor >>>> >>>> On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov >>>> wrote: >>>>> it seems in your code you have without >>>>> returning anything. Since 'if (undefined)' is 'false' the call stops >>>>> there. >>>>> >>>>> On Fri, Sep 16, 2011 at 3:25 PM, Wayne W >>>>> wrote: >>>>>> and in what case does it not return anything? >>>>>> >>>>>> >>>>>> On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov >>>>>> wrote: >>>>>>> It should return true or false. >>>>>>> False if there is some reason to not submit the form, for example >>>>>>> client side validation failed. >>>>>>> True if everything is OK and the submit can proceed. >>>>>>> >>>>>>> On Fri, Sep 16, 2011 at 6:21 AM, Wayne W >>>>>>> wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that >>>>>>>> AjaxSubmitLink is not working (at least with one form). >>>>>>>> >>>>>>>> The form doesn't get submitted - the problem in wicket-ajax.js is >>>>>>>> (~line 1120): >>>>>>>> >>>>>>>> // Submits a form using ajax. >>>>>>>> // This method serializes a form and sends it as POST body. >>>>>>>> submitForm: function(form, submitButton) { >>>>>>>> var submittingAttribute = 'data-wicket-submitting'; >>>>>>>> if (form.onsubmit && >>>>>>>> !form.getAttribute(submittingAttribute)) { >>>>>>>> form.setAttribute(submittingAttribute, >>>>>>>> submittingAttribute); >>>>>>>> var retValue = form.onsubmit(); >>>>>>>> form.removeAttribute(submittingAttribute); >>>>>>>> if (!retValue) return; >>>>>>>> } >>>>>>>> >>>>>>>> >>>>>>>> The problem is var retValue = form.onsubmit(); does not return any >>>>>>>> value (retValue remains undefined) and hence it returns and doesn't do >>>>>>>> the submit. I don't know enough about javascript to really understand >>>>>>>> whats happening here. The form is fairly unremarkable. >>>>>>>> >>>>>>>> For now I've patch the wicket-ajax.js code and comment out the return, >>>>>>>> and it works fine again. I notice this code here was not in 1.4.8. But >>>>>>>> obviously this is not the solution. >>>>>>>> >>>>>>>> So I imagine it something to do with the form, but I don't know where >>>>>>>> to start and look - what is normally returned by form.onsubmit();? >>>>>>>> what can I look for? >>>>>>>> >>>>>>>> many than
Re: AjaxSubmitLink 1.4.18 issue/not working
no. i thikn it should be if (typeof(retVal)=="undefined") retVal=true; -igor On Fri, Sep 16, 2011 at 10:58 AM, Martin Grigorov wrote: > return (typeOf retVal === "undefined" || retVal === true) > > in all other cases stop the submit > > looks OK ? > > On Fri, Sep 16, 2011 at 8:57 PM, Martin Grigorov wrote: >> Yes, sounds like a good idea. >> What if the user code returns an object ? >> >> On Fri, Sep 16, 2011 at 6:11 PM, Igor Vaynberg >> wrote: >>> i think in this case we should define the undefined to be true... >>> >>> -igor >>> >>> On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov >>> wrote: >>>> it seems in your code you have without >>>> returning anything. Since 'if (undefined)' is 'false' the call stops >>>> there. >>>> >>>> On Fri, Sep 16, 2011 at 3:25 PM, Wayne W >>>> wrote: >>>>> and in what case does it not return anything? >>>>> >>>>> >>>>> On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov >>>>> wrote: >>>>>> It should return true or false. >>>>>> False if there is some reason to not submit the form, for example >>>>>> client side validation failed. >>>>>> True if everything is OK and the submit can proceed. >>>>>> >>>>>> On Fri, Sep 16, 2011 at 6:21 AM, Wayne W >>>>>> wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that >>>>>>> AjaxSubmitLink is not working (at least with one form). >>>>>>> >>>>>>> The form doesn't get submitted - the problem in wicket-ajax.js is >>>>>>> (~line 1120): >>>>>>> >>>>>>> // Submits a form using ajax. >>>>>>> // This method serializes a form and sends it as POST body. >>>>>>> submitForm: function(form, submitButton) { >>>>>>> var submittingAttribute = 'data-wicket-submitting'; >>>>>>> if (form.onsubmit && >>>>>>> !form.getAttribute(submittingAttribute)) { >>>>>>> form.setAttribute(submittingAttribute, >>>>>>> submittingAttribute); >>>>>>> var retValue = form.onsubmit(); >>>>>>> form.removeAttribute(submittingAttribute); >>>>>>> if (!retValue) return; >>>>>>> } >>>>>>> >>>>>>> >>>>>>> The problem is var retValue = form.onsubmit(); does not return any >>>>>>> value (retValue remains undefined) and hence it returns and doesn't do >>>>>>> the submit. I don't know enough about javascript to really understand >>>>>>> whats happening here. The form is fairly unremarkable. >>>>>>> >>>>>>> For now I've patch the wicket-ajax.js code and comment out the return, >>>>>>> and it works fine again. I notice this code here was not in 1.4.8. But >>>>>>> obviously this is not the solution. >>>>>>> >>>>>>> So I imagine it something to do with the form, but I don't know where >>>>>>> to start and look - what is normally returned by form.onsubmit();? >>>>>>> what can I look for? >>>>>>> >>>>>>> many thanks >>>>>>> >>>>>>> - >>>>>>> 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 >>>>>> >>>>>> >>>>> >>>>> - >>>>> 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 >>>> >>>> >>> >>> - >>> 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 >> > > > > -- > 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 > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxSubmitLink 1.4.18 issue/not working
then let the default behavior happen. only convert to "true" if the return type is undefiend. -igor On Fri, Sep 16, 2011 at 10:57 AM, Martin Grigorov wrote: > Yes, sounds like a good idea. > What if the user code returns an object ? > > On Fri, Sep 16, 2011 at 6:11 PM, Igor Vaynberg > wrote: >> i think in this case we should define the undefined to be true... >> >> -igor >> >> On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov >> wrote: >>> it seems in your code you have without >>> returning anything. Since 'if (undefined)' is 'false' the call stops >>> there. >>> >>> On Fri, Sep 16, 2011 at 3:25 PM, Wayne W >>> wrote: >>>> and in what case does it not return anything? >>>> >>>> >>>> On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov >>>> wrote: >>>>> It should return true or false. >>>>> False if there is some reason to not submit the form, for example >>>>> client side validation failed. >>>>> True if everything is OK and the submit can proceed. >>>>> >>>>> On Fri, Sep 16, 2011 at 6:21 AM, Wayne W >>>>> wrote: >>>>>> Hi, >>>>>> >>>>>> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that >>>>>> AjaxSubmitLink is not working (at least with one form). >>>>>> >>>>>> The form doesn't get submitted - the problem in wicket-ajax.js is (~line >>>>>> 1120): >>>>>> >>>>>> // Submits a form using ajax. >>>>>> // This method serializes a form and sends it as POST body. >>>>>> submitForm: function(form, submitButton) { >>>>>> var submittingAttribute = 'data-wicket-submitting'; >>>>>> if (form.onsubmit && >>>>>> !form.getAttribute(submittingAttribute)) { >>>>>> form.setAttribute(submittingAttribute, >>>>>> submittingAttribute); >>>>>> var retValue = form.onsubmit(); >>>>>> form.removeAttribute(submittingAttribute); >>>>>> if (!retValue) return; >>>>>> } >>>>>> >>>>>> >>>>>> The problem is var retValue = form.onsubmit(); does not return any >>>>>> value (retValue remains undefined) and hence it returns and doesn't do >>>>>> the submit. I don't know enough about javascript to really understand >>>>>> whats happening here. The form is fairly unremarkable. >>>>>> >>>>>> For now I've patch the wicket-ajax.js code and comment out the return, >>>>>> and it works fine again. I notice this code here was not in 1.4.8. But >>>>>> obviously this is not the solution. >>>>>> >>>>>> So I imagine it something to do with the form, but I don't know where >>>>>> to start and look - what is normally returned by form.onsubmit();? >>>>>> what can I look for? >>>>>> >>>>>> many thanks >>>>>> >>>>>> - >>>>>> 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 >>>>> >>>>> >>>> >>>> - >>>> 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 >>> >>> >> >> - >> 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 > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxSubmitLink 1.4.18 issue/not working
return (typeOf retVal === "undefined" || retVal === true) in all other cases stop the submit looks OK ? On Fri, Sep 16, 2011 at 8:57 PM, Martin Grigorov wrote: > Yes, sounds like a good idea. > What if the user code returns an object ? > > On Fri, Sep 16, 2011 at 6:11 PM, Igor Vaynberg > wrote: >> i think in this case we should define the undefined to be true... >> >> -igor >> >> On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov >> wrote: >>> it seems in your code you have without >>> returning anything. Since 'if (undefined)' is 'false' the call stops >>> there. >>> >>> On Fri, Sep 16, 2011 at 3:25 PM, Wayne W >>> wrote: >>>> and in what case does it not return anything? >>>> >>>> >>>> On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov >>>> wrote: >>>>> It should return true or false. >>>>> False if there is some reason to not submit the form, for example >>>>> client side validation failed. >>>>> True if everything is OK and the submit can proceed. >>>>> >>>>> On Fri, Sep 16, 2011 at 6:21 AM, Wayne W >>>>> wrote: >>>>>> Hi, >>>>>> >>>>>> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that >>>>>> AjaxSubmitLink is not working (at least with one form). >>>>>> >>>>>> The form doesn't get submitted - the problem in wicket-ajax.js is (~line >>>>>> 1120): >>>>>> >>>>>> // Submits a form using ajax. >>>>>> // This method serializes a form and sends it as POST body. >>>>>> submitForm: function(form, submitButton) { >>>>>> var submittingAttribute = 'data-wicket-submitting'; >>>>>> if (form.onsubmit && >>>>>> !form.getAttribute(submittingAttribute)) { >>>>>> form.setAttribute(submittingAttribute, >>>>>> submittingAttribute); >>>>>> var retValue = form.onsubmit(); >>>>>> form.removeAttribute(submittingAttribute); >>>>>> if (!retValue) return; >>>>>> } >>>>>> >>>>>> >>>>>> The problem is var retValue = form.onsubmit(); does not return any >>>>>> value (retValue remains undefined) and hence it returns and doesn't do >>>>>> the submit. I don't know enough about javascript to really understand >>>>>> whats happening here. The form is fairly unremarkable. >>>>>> >>>>>> For now I've patch the wicket-ajax.js code and comment out the return, >>>>>> and it works fine again. I notice this code here was not in 1.4.8. But >>>>>> obviously this is not the solution. >>>>>> >>>>>> So I imagine it something to do with the form, but I don't know where >>>>>> to start and look - what is normally returned by form.onsubmit();? >>>>>> what can I look for? >>>>>> >>>>>> many thanks >>>>>> >>>>>> - >>>>>> 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 >>>>> >>>>> >>>> >>>> - >>>> 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 >>> >>> >> >> - >> 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 > -- 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 1.4.18 issue/not working
Yes, sounds like a good idea. What if the user code returns an object ? On Fri, Sep 16, 2011 at 6:11 PM, Igor Vaynberg wrote: > i think in this case we should define the undefined to be true... > > -igor > > On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov wrote: >> it seems in your code you have without >> returning anything. Since 'if (undefined)' is 'false' the call stops >> there. >> >> On Fri, Sep 16, 2011 at 3:25 PM, Wayne W wrote: >>> and in what case does it not return anything? >>> >>> >>> On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov >>> wrote: >>>> It should return true or false. >>>> False if there is some reason to not submit the form, for example >>>> client side validation failed. >>>> True if everything is OK and the submit can proceed. >>>> >>>> On Fri, Sep 16, 2011 at 6:21 AM, Wayne W >>>> wrote: >>>>> Hi, >>>>> >>>>> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that >>>>> AjaxSubmitLink is not working (at least with one form). >>>>> >>>>> The form doesn't get submitted - the problem in wicket-ajax.js is (~line >>>>> 1120): >>>>> >>>>> // Submits a form using ajax. >>>>> // This method serializes a form and sends it as POST body. >>>>> submitForm: function(form, submitButton) { >>>>> var submittingAttribute = 'data-wicket-submitting'; >>>>> if (form.onsubmit && >>>>> !form.getAttribute(submittingAttribute)) { >>>>> form.setAttribute(submittingAttribute, >>>>> submittingAttribute); >>>>> var retValue = form.onsubmit(); >>>>> form.removeAttribute(submittingAttribute); >>>>> if (!retValue) return; >>>>> } >>>>> >>>>> >>>>> The problem is var retValue = form.onsubmit(); does not return any >>>>> value (retValue remains undefined) and hence it returns and doesn't do >>>>> the submit. I don't know enough about javascript to really understand >>>>> whats happening here. The form is fairly unremarkable. >>>>> >>>>> For now I've patch the wicket-ajax.js code and comment out the return, >>>>> and it works fine again. I notice this code here was not in 1.4.8. But >>>>> obviously this is not the solution. >>>>> >>>>> So I imagine it something to do with the form, but I don't know where >>>>> to start and look - what is normally returned by form.onsubmit();? >>>>> what can I look for? >>>>> >>>>> many thanks >>>>> >>>>> - >>>>> 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 >>>> >>>> >>> >>> - >>> 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 >> >> > > - > 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 1.4.18 issue/not working
i think in this case we should define the undefined to be true... -igor On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov wrote: > it seems in your code you have without > returning anything. Since 'if (undefined)' is 'false' the call stops > there. > > On Fri, Sep 16, 2011 at 3:25 PM, Wayne W wrote: >> and in what case does it not return anything? >> >> >> On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov >> wrote: >>> It should return true or false. >>> False if there is some reason to not submit the form, for example >>> client side validation failed. >>> True if everything is OK and the submit can proceed. >>> >>> On Fri, Sep 16, 2011 at 6:21 AM, Wayne W >>> wrote: >>>> Hi, >>>> >>>> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that >>>> AjaxSubmitLink is not working (at least with one form). >>>> >>>> The form doesn't get submitted - the problem in wicket-ajax.js is (~line >>>> 1120): >>>> >>>> // Submits a form using ajax. >>>> // This method serializes a form and sends it as POST body. >>>> submitForm: function(form, submitButton) { >>>> var submittingAttribute = 'data-wicket-submitting'; >>>> if (form.onsubmit && >>>> !form.getAttribute(submittingAttribute)) { >>>> form.setAttribute(submittingAttribute, >>>> submittingAttribute); >>>> var retValue = form.onsubmit(); >>>> form.removeAttribute(submittingAttribute); >>>> if (!retValue) return; >>>> } >>>> >>>> >>>> The problem is var retValue = form.onsubmit(); does not return any >>>> value (retValue remains undefined) and hence it returns and doesn't do >>>> the submit. I don't know enough about javascript to really understand >>>> whats happening here. The form is fairly unremarkable. >>>> >>>> For now I've patch the wicket-ajax.js code and comment out the return, >>>> and it works fine again. I notice this code here was not in 1.4.8. But >>>> obviously this is not the solution. >>>> >>>> So I imagine it something to do with the form, but I don't know where >>>> to start and look - what is normally returned by form.onsubmit();? >>>> what can I look for? >>>> >>>> many thanks >>>> >>>> - >>>> 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 >>> >>> >> >> - >> 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 > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxSubmitLink 1.4.18 issue/not working
it seems in your code you have without returning anything. Since 'if (undefined)' is 'false' the call stops there. On Fri, Sep 16, 2011 at 3:25 PM, Wayne W wrote: > and in what case does it not return anything? > > > On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov wrote: >> It should return true or false. >> False if there is some reason to not submit the form, for example >> client side validation failed. >> True if everything is OK and the submit can proceed. >> >> On Fri, Sep 16, 2011 at 6:21 AM, Wayne W wrote: >>> Hi, >>> >>> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that >>> AjaxSubmitLink is not working (at least with one form). >>> >>> The form doesn't get submitted - the problem in wicket-ajax.js is (~line >>> 1120): >>> >>> // Submits a form using ajax. >>> // This method serializes a form and sends it as POST body. >>> submitForm: function(form, submitButton) { >>> var submittingAttribute = 'data-wicket-submitting'; >>> if (form.onsubmit && >>> !form.getAttribute(submittingAttribute)) { >>> form.setAttribute(submittingAttribute, >>> submittingAttribute); >>> var retValue = form.onsubmit(); >>> form.removeAttribute(submittingAttribute); >>> if (!retValue) return; >>> } >>> >>> >>> The problem is var retValue = form.onsubmit(); does not return any >>> value (retValue remains undefined) and hence it returns and doesn't do >>> the submit. I don't know enough about javascript to really understand >>> whats happening here. The form is fairly unremarkable. >>> >>> For now I've patch the wicket-ajax.js code and comment out the return, >>> and it works fine again. I notice this code here was not in 1.4.8. But >>> obviously this is not the solution. >>> >>> So I imagine it something to do with the form, but I don't know where >>> to start and look - what is normally returned by form.onsubmit();? >>> what can I look for? >>> >>> many thanks >>> >>> - >>> 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 >> >> > > - > 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 1.4.18 issue/not working
and in what case does it not return anything? On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov wrote: > It should return true or false. > False if there is some reason to not submit the form, for example > client side validation failed. > True if everything is OK and the submit can proceed. > > On Fri, Sep 16, 2011 at 6:21 AM, Wayne W wrote: >> Hi, >> >> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that >> AjaxSubmitLink is not working (at least with one form). >> >> The form doesn't get submitted - the problem in wicket-ajax.js is (~line >> 1120): >> >> // Submits a form using ajax. >> // This method serializes a form and sends it as POST body. >> submitForm: function(form, submitButton) { >> var submittingAttribute = 'data-wicket-submitting'; >> if (form.onsubmit && !form.getAttribute(submittingAttribute)) >> { >> form.setAttribute(submittingAttribute, >> submittingAttribute); >> var retValue = form.onsubmit(); >> form.removeAttribute(submittingAttribute); >> if (!retValue) return; >> } >> >> >> The problem is var retValue = form.onsubmit(); does not return any >> value (retValue remains undefined) and hence it returns and doesn't do >> the submit. I don't know enough about javascript to really understand >> whats happening here. The form is fairly unremarkable. >> >> For now I've patch the wicket-ajax.js code and comment out the return, >> and it works fine again. I notice this code here was not in 1.4.8. But >> obviously this is not the solution. >> >> So I imagine it something to do with the form, but I don't know where >> to start and look - what is normally returned by form.onsubmit();? >> what can I look for? >> >> many thanks >> >> - >> 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 > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxSubmitLink 1.4.18 issue/not working
It should return true or false. False if there is some reason to not submit the form, for example client side validation failed. True if everything is OK and the submit can proceed. On Fri, Sep 16, 2011 at 6:21 AM, Wayne W wrote: > Hi, > > I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that > AjaxSubmitLink is not working (at least with one form). > > The form doesn't get submitted - the problem in wicket-ajax.js is (~line > 1120): > > // Submits a form using ajax. > // This method serializes a form and sends it as POST body. > submitForm: function(form, submitButton) { > var submittingAttribute = 'data-wicket-submitting'; > if (form.onsubmit && !form.getAttribute(submittingAttribute)) { > form.setAttribute(submittingAttribute, > submittingAttribute); > var retValue = form.onsubmit(); > form.removeAttribute(submittingAttribute); > if (!retValue) return; > } > > > The problem is var retValue = form.onsubmit(); does not return any > value (retValue remains undefined) and hence it returns and doesn't do > the submit. I don't know enough about javascript to really understand > whats happening here. The form is fairly unremarkable. > > For now I've patch the wicket-ajax.js code and comment out the return, > and it works fine again. I notice this code here was not in 1.4.8. But > obviously this is not the solution. > > So I imagine it something to do with the form, but I don't know where > to start and look - what is normally returned by form.onsubmit();? > what can I look for? > > many thanks > > - > 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
AjaxSubmitLink 1.4.18 issue/not working
Hi, I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that AjaxSubmitLink is not working (at least with one form). The form doesn't get submitted - the problem in wicket-ajax.js is (~line 1120): // Submits a form using ajax. // This method serializes a form and sends it as POST body. submitForm: function(form, submitButton) { var submittingAttribute = 'data-wicket-submitting'; if (form.onsubmit && !form.getAttribute(submittingAttribute)) { form.setAttribute(submittingAttribute, submittingAttribute); var retValue = form.onsubmit(); form.removeAttribute(submittingAttribute); if (!retValue) return; } The problem is var retValue = form.onsubmit(); does not return any value (retValue remains undefined) and hence it returns and doesn't do the submit. I don't know enough about javascript to really understand whats happening here. The form is fairly unremarkable. For now I've patch the wicket-ajax.js code and comment out the return, and it works fine again. I notice this code here was not in 1.4.8. But obviously this is not the solution. So I imagine it something to do with the form, but I don't know where to start and look - what is normally returned by form.onsubmit();? what can I look for? many thanks - 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
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
Hello, I have ModalWindow with form inside html: 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
Re: AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception
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> ... 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
Re: AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception
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 wrote: > Hello, > > I have ModalWindow with form inside > > html: > > 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
AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception
Hello, I have ModalWindow with form inside html: 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 problem
use the formCoponent.getRawInput() On Wed, Oct 27, 2010 at 12:24 PM, Anna Simbirtsev wrote: > Hi, > > I am using AjaxSubmitLink and I have setDefaultFormProcessing(false) > to avoid form validation. The only problem is that none of the form > values get submitted. If I need to get the value of one of the fields, > how do I do that? > > Thanks, > Anna > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Pedro Henrique Oliveira dos Santos
AjaxSubmitLink problem
Hi, I am using AjaxSubmitLink and I have setDefaultFormProcessing(false) to avoid form validation. The only problem is that none of the form values get submitted. If I need to get the value of one of the fields, how do I do that? Thanks, Anna - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
statelessform and ajaxsubmitlink in the same page
Hi! I have a page with 1 statelessform and another form that use ajaxsubmitlink. I overrides the isStateless method to return false to avoid ajaxsubmitlink fail but when the normal form is submited wicket throws exception with text: "... deserializing proxy...". Is possible have a statelessform and ajaxsubmitlink in the same page? thanks!
Re: How to put a loading cursor in ajaxsubmitlink?
http://visural-wicket-examples.appspot.com/app/submitters <http://visural-wicket-examples.appspot.com/app/submitters> Fausto A. Bencosme D. Software Developer KindleIT.net S.R.L email: fbenco...@kitsd.com cel: 809-923-0123 On Sat, Jul 24, 2010 at 10:42 AM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > http://www.wicket-library.com/wicket-examples/ajax/links.0 > > 2010/7/24 Gustavo Henrique : > > Hi! > > How to put a loading cursor in ajaxsubmitlink? > > > > thanks! > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >