Re: setResponsePage weirdness
syg6 wrote: > > ... > setResponsePage(SecondPage.class) in FirstPage's constructor is called the > url remains: > > http://localhost:8080/myapp/first > > when I am actually now on SecondPage? But when I call > setResponsePage(ThirdPage.class) from SecondPageForm's onSubmit() > (SecondPage contains SecondPageForm), the url is: > > http://localhost:8080/myapp/third > > I've tried sticking setRedirect(true) in a few places but that seems to > mess up my custom session; my custom session is constantly reset, previous > info stored in the session is wiped out. > > I've also tried using setResponsePage(new SecondPage()) but it doesn't > seem to change the url and SecondPage.html breaks, it's telling me none of > my form components are present! > throw a RestartResponseException or a RestartResponseAtInterceptPageException (I always forget which is the right one) instead of setResponsePage Cheers Hans -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/setResponsePage-weirdness-tp3248650p3253687.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: setResponsePage weirdness
Worse case scenario, though I understand not wanting to do it, is using a javascript/html redirect and by passing Wicket, not the nicest scenario, I wish I knew more about redirects, sorry. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/setResponsePage-weirdness-tp3248650p3251802.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: setResponsePage weirdness
Okay, So don't use a link on the html page for FirstPage. Try redirecting when there is an html page with some filler, try adding a wicket label if plain html doesn't work. Although it's not the best solution it will narrow down the problem! The Wizard is useful in the sense, you can go back and forth for the user and it is all in one page etc There is nothing "amazing" about the wizard, just that it seems your trying to do the same thing, and it would handle making each step and not allowing one to skip to the second page because they bookmarked the url No worries about the ranting, I do it all the time. Matthew syg6 wrote: > > Hi and thanks for the response. > > No, FirstPage doesn't add anything to the page. It checks a param passed > to it and redirects to one page or the other. Just for a test, I made a > FirstPage.html with a link to SecondPage and had FirstPage.java just bring > me to FirstPage.html, instead of doing a redirect. When I click on it the > url changes correctly, unlike when I do a setResponsePage(SecondPage) from > HomePage. But I don't need to 'stop' on FirstPage ... in fact I don't even > have a FirstPage.html because I always redirect somewhere else. > > As for using a Wizard ... I thought about it and looked into it but it > doesn't seem do too much. I only have 3 pages in my wizard and and > controlling access to the 2nd and 3rd pages with a custom session object. > ie, when you click on the link in the HomePage, if everything is correct > (right parameters), I stick something in the session and redirect to > page2. I do the same with page2. So access to the pages is controlled by > my custom session object. Would it be that much easier with a wizard? I > guess it would control the order of the pages but I would still need to > stick my own logic in there because it's not just about the order of the > pages, it also needs to validate other stuff. > > Anyway ...sorry to rant. Thanks for your help. Any other ideas much > appreciated. > > Bob > -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/setResponsePage-weirdness-tp3248650p3249263.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: setResponsePage weirdness
You might want to use a Wizard for the record. Just curious does "first page" add anything to the page, perhaps a new url and redirect is not necessary if no Wicket Components were added, try adding some Wicket Label about a redirect or something (just trying to narrow this down). Just curious, the way you have it, in theory a user really could enter the second or third page without the previous page(s), with the url, no? I suggest look into making a wizard component http://www.wicket-library.com/wicket-examples/wizard/ . Matthew syg6 wrote: > > I have a few mounts set up: > > mount(new QueryStringUrlCodingStrategy("/first", FirstPage.class)); > mount(new QueryStringUrlCodingStrategy("/second", SecondPage.class)); > mount(new QueryStringUrlCodingStrategy("/third", ThirdPage.class)); > > And in HomePage I have a link to FirstPage: > > add(new BookmarkablePageLink("firstPageLink", > FirstPage.class, parameters)); > > All FirstPage does is verify some parameters sent to it and do a > setResponse() to SecondPage. > > Why is it that when I click on the link in HomePage, to FirstPage, when > setResponsePage(SecondPage.class) in FirstPage's constructor is called the > url remains: > > http://localhost:8080/myapp/first > > when I am actually now on SecondPage? But when I call > setResponsePage(ThirdPage.class) from SecondPageForm's onSubmit() > (SecondPage contains SecondPageForm), the url is: > > http://localhost:8080/myapp/third > > I've tried sticking setRedirect(true) in a few places but that seems to > mess up my custom session; my custom session is constantly reset, previous > info stored in the session is wiped out. > > I've also tried using setResponsePage(new SecondPage()) but it doesn't > seem to change the url and SecondPage.html breaks, it's telling me none of > my form components are present! > > Both SecondPage and ThirdPage *can* (and should!) be tied to the session, > the user must never be able to enter directly into either one, but rather > first enter FirstPage. > > Can someone tell me what I am doing wrong? > > Thanks, > Bob > -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/setResponsePage-weirdness-tp3248650p3249002.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