On Thu, Jan 19, 2012 at 6:54 PM, Chris Colman <[email protected]> wrote: >>You can pass PageReference to the page with the form and use it in >>Form#onSubmit(). >> >>Page1.java: >> >>setResponsePage(new FormPage(getPageReference())); >> >>FormPage.java: >> >>public FormPage(final PageReference pr) { >> >> add(new Form() { >> onSubmit() { >> setResponsePage(pr.getPage()); >> } >> }); >>} > > PageReference looks nice. I hadn't noticed that class before. So it's a > reference to a page instance in a page store? > > Will this just return the existing 'instance' of the page exactly the > way it was before the user went to the form or will it use the page URL > to perform a re-render and show any model updates that submitting the > form may have caused?
It will get the previous (instance of the) page by id and show it. If this page uses dynamic models the you are fine. > >> >> >> >>On Thu, Jan 19, 2012 at 2:39 AM, Chris Colman >><[email protected]>wrote: >> >>> ** ** >>> >>> I often use modal forms/dialogs so this issue is not a problem: In a >>modal >>> scenario when the user submits a modal the page they called the modal >>form >>> from is just sitting there behind the form when it closes - no need > for >>> redirection to the 'calling page' as it's redundant.**** >>> >>> ** ** >>> >>> In scenarios where some customers prefer not to have modal forms the >>forms >>> have to be pages in their own right and involve the 'browser page > change' >>> dance.**** >>> >>> ** ** >>> >>> Is there a best practice in Wicket for making reusable page forms > that >>> remember which page called them and return to that page after submit > or >>> cancel? Or is there a Wicket class that manages this?**** >>> >>> ** ** >>> >>> Example scenario for Reusable Address form**** >>> >>> ** ** >>> >>> Scenario 1**** >>> >>> ** ** >>> >>> Page A shows supplier's data with a panel displaying their address > which >>> includes a 'Change' button.**** >>> >>> ** ** >>> >>> User clicks change and is taken to Address form page.**** >>> >>> ** ** >>> >>> User makes changes and hits ok. The browser returns to page A.**** >>> >>> ** ** >>> >>> Scenario 2**** >>> >>> ** ** >>> >>> Page B shows customer's data with a panel display their address which >>> includes a 'Change' button.**** >>> >>> ** ** >>> >>> User clicks change and is taken to Address form page.**** >>> >>> ** ** >>> >>> User makes changes and hits ok. The browser returns to page B.**** >>> >>> **** >>> >>> ** ** >>> >>> Yours sincerely,**** >>> >>> ** ** >>> >>> Chris Colman**** >>> >>> **** >>> >>> Pagebloom Team Leader,**** >>> >>> Step Ahead Software >>> >>> **** >>> >>> pagebloom - your business & your website growing together**** >>> >>> ** ** >>> >>> **Sydney**: (+61 2) 9656 1278 ****Canberra****: (+61 2) 6100 2120 >>> **** >>> >>> Email: [email protected] <//[email protected]>**** >>> >>> Website:**** >>> >>> http://www.pagebloom.com**** >>> >>> http://develop.stepaheadsoftware.com**** >>> >>> **** >>> >>> ** ** >>> >> >> >> >>-- >>Martin Grigorov >>jWeekend >>Training, Consulting, Development >>http://jWeekend.com <http://jweekend.com/> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
