You could make the address form have an abstract method to determine where to 
redirect to. In the form submit call the abstract method  The the page 
constructor could take a param to tell which page to redirect to.  Define the 
abstract method on the page to do the redirect based on the parameter passed to 
the page. Or you could have individual pages that all use the same address 
form. 

On Jan 18, 2012, at 8:39 PM, "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]
> Website:
> http://www.pagebloom.com
> http://develop.stepaheadsoftware.com
>  
>  

Reply via email to