>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?

>
>
>
>On Thu, Jan 19, 2012 at 2:39 AM, Chris Colman
><chr...@stepaheadsoftware.com>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: chr...@stepahead.com.au <//chr...@stepahead.com.au>****
>>
>> 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: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to