Re: Best practice for returning to calling page after submitting a form page

2012-01-19 Thread Martin Grigorov
On Thu, Jan 19, 2012 at 6:54 PM, Chris Colman 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 Fo

RE: Best practice for returning to calling page after submitting a form page

2012-01-19 Thread Chris Colman
>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()); >

Re: Best practice for returning to calling page after submitting a form page

2012-01-19 Thread Martin Grigorov
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()); } }); }

Re: Best practice for returning to calling page after submitting a form page

2012-01-18 Thread Jeff Schneller
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