I've created a multi-page wizard-like portlet. The last page is a confirmation page and there isn't any button or link on it to go back to the first page after the process is complete. Once the wizard is completed, how can I get the confirmation page to display only once and then restart the wizard at the initial page?
Attached is a sample portlet that implements a wizard-type interface. The last page of the portlet is a confirmation page, showing only a status message that the steps were completed. This model uses a pair of Event Handler builders to detect that the confirmation page has been rendered and automatically restarts the wizard at the initial page the next time the portlet is asked to render.
The important steps:
- showConfirmPage Action List - this action list first sets a flag (confirmPageRendered) to false then executes the action to show the confirmPage
- Page:confirmPage:OnPageLoad Event Handler - this event handler runs when the confirmPage is rendered and simply sets the confirmPageRendered flag
- System:OnRequest Event Handler - this event handler runs at every request to the portlet and runs the handleRestartWizard method
- handleRestartWizard Method - this method checks the current request to see if it a request to render the confirmPage AND what the status of the confirmPageRendered flag is - if both conditions are met, the wizard is restarted at the initial page
Download the sample model here: WizardSample.model