How to redirect to a page from an AJAX request?
Hello, I use AjaxSubmitLink to submit a form that has captcha. I refresh captcha by adding it to ajax request. However, when the user successfully submits the form I want to redirect the user to a different page. I tried setResponsePage and throw new RestartResponseException in AjaxSubmitLink#onSubmit, but they seem to have no effect. How can I redirect the user to a page from an ajax request? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to redirect to a page from an AJAX request?
IFAIK setResponsePage(Page.class) should work: at least I remember using it successfully on an AJAX request cycle to redirect to a different page. Regards, Melinda On Tue, May 22, 2012 at 2:41 AM, Alec Swan wrote: > Hello, > > I use AjaxSubmitLink to submit a form that has captcha. I refresh > captcha by adding it to ajax request. However, when the user > successfully submits the form I want to redirect the user to a > different page. I tried setResponsePage and throw new > RestartResponseException in AjaxSubmitLink#onSubmit, but they seem to > have no effect. > > How can I redirect the user to a page from an ajax request? > > Thanks, > > Alec > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: How to redirect to a page from an AJAX request?
hi! you could check it with the Wicket Ajax Debug - for the ajax redirect it should receive and process javascript instruction which resets location of the page. maybe there are some JS errors out there? On May 22, 2012 8:59 AM, "Melinda Dweer" wrote: > IFAIK setResponsePage(Page.class) should work: at least I remember using it > successfully on an AJAX request cycle to redirect to a different page. > > Regards, > > Melinda > > On Tue, May 22, 2012 at 2:41 AM, Alec Swan wrote: > > > Hello, > > > > I use AjaxSubmitLink to submit a form that has captcha. I refresh > > captcha by adding it to ajax request. However, when the user > > successfully submits the form I want to redirect the user to a > > different page. I tried setResponsePage and throw new > > RestartResponseException in AjaxSubmitLink#onSubmit, but they seem to > > have no effect. > > > > How can I redirect the user to a page from an ajax request? > > > > Thanks, > > > > Alec > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > >
Re: How to redirect to a page from an AJAX request?
My apologies, setResponsePage does work from AJAX requests. I had two problems - one with a missing JS reference which I detected by looking at Wicket Ajax Debug and the other one with my Wicket test class. Thanks, Alec On Tue, May 22, 2012 at 12:08 AM, Alexander Cherednichenko wrote: > hi! > > you could check it with the Wicket Ajax Debug - for the ajax redirect it > should receive and process javascript instruction which resets location of > the page. > > maybe there are some JS errors out there? > On May 22, 2012 8:59 AM, "Melinda Dweer" wrote: > >> IFAIK setResponsePage(Page.class) should work: at least I remember using it >> successfully on an AJAX request cycle to redirect to a different page. >> >> Regards, >> >> Melinda >> >> On Tue, May 22, 2012 at 2:41 AM, Alec Swan wrote: >> >> > Hello, >> > >> > I use AjaxSubmitLink to submit a form that has captcha. I refresh >> > captcha by adding it to ajax request. However, when the user >> > successfully submits the form I want to redirect the user to a >> > different page. I tried setResponsePage and throw new >> > RestartResponseException in AjaxSubmitLink#onSubmit, but they seem to >> > have no effect. >> > >> > How can I redirect the user to a page from an ajax request? >> > >> > Thanks, >> > >> > Alec >> > >> > - >> > 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