net.jspcontrols.dialogs.actions.wizard
Class WizardForm

java.lang.Object
  extended byorg.apache.struts.action.ActionForm
      extended bynet.jspcontrols.dialogs.actions.wizard.WizardForm
All Implemented Interfaces:
IWizardManager, java.io.Serializable

public class WizardForm
extends org.apache.struts.action.ActionForm
implements IWizardManager

Base wizard form. Custom wizard implementation can either (1) extend basic ActionForm class and implement IWizardManager interface, or (2) extend this predefined wizard form.

See Also:
Serialized Form

Field Summary
protected  net.jspcontrols.wizard.intf.IWizard wizard
          Wizard controller; must be set prior to populate phase
 
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
 
Constructor Summary
WizardForm()
           
 
Method Summary
 void disposeWizard()
          Disposes wizard and performs housekeeping tasks like removing messages, event listeneres and other objects created by wizard.
 java.util.Map getWizardErrors()
          Returns errors accumulated by wizard during processing of input data.
 java.lang.String getWizardView()
          Returns string mapping of the wizard page, corresponding to current wizard state.
 boolean isCompleted()
          Returns true if wizard was completed or was never instantiated; after wizard completes, it should not be accessed anymore.
 void reset(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
          Resets action form.
 java.lang.String wizardBack()
          Tries to go one step back.
 java.lang.String wizardCancel()
          Cancels wizard.
 java.lang.String wizardNext()
          Tries to go one step forward.
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, reset, setMultipartRequestHandler, setServlet, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wizard

protected net.jspcontrols.wizard.intf.IWizard wizard
Wizard controller; must be set prior to populate phase

Constructor Detail

WizardForm

public WizardForm()
Method Detail

getWizardErrors

public java.util.Map getWizardErrors()
Returns errors accumulated by wizard during processing of input data.

Specified by:
getWizardErrors in interface IWizardManager

wizardCancel

public java.lang.String wizardCancel()
Cancels wizard.

Specified by:
wizardCancel in interface IWizardManager
Returns:
string mapping describing the after-cancel View

wizardBack

public java.lang.String wizardBack()
Tries to go one step back. Wizard does not allow to move past first step.

Specified by:
wizardBack in interface IWizardManager
Returns:
string mapping describing the after-back View. If successfully moved one step back, MAPPING_ON_BACK_SUCCESS is returned. Otherwise, MAPPING_ON_BACK_FAILURE is returned.
See Also:
WizardConstants.MAPPING_ON_BACK_SUCCESS, WizardConstants.MAPPING_ON_BACK_FAILURE

wizardNext

public java.lang.String wizardNext()
Tries to go one step forward.

Specified by:
wizardNext in interface IWizardManager
Returns:
string mapping describing the after-forward View If successfully moved one step forward, and wizard is not finished yet, MAPPING_ON_NEXT_SUCCESS is returned. If wizard was finished, MAPPING_ON_DONE is returned. Otherwise, MAPPING_ON_NEXT_FAILURE is returned.
See Also:
WizardConstants.MAPPING_ON_NEXT_SUCCESS, WizardConstants.MAPPING_ON_NEXT_FAILURE, WizardConstants.MAPPING_ON_DONE

disposeWizard

public void disposeWizard()
Disposes wizard and performs housekeeping tasks like removing messages, event listeneres and other objects created by wizard.

Specified by:
disposeWizard in interface IWizardManager

isCompleted

public boolean isCompleted()
Returns true if wizard was completed or was never instantiated; after wizard completes, it should not be accessed anymore.

Specified by:
isCompleted in interface IWizardManager

getWizardView

public java.lang.String getWizardView()
Returns string mapping of the wizard page, corresponding to current wizard state. By convention, uses the name of wizard step. Always use unique names for wizard steps.

Specified by:
getWizardView in interface IWizardManager

reset

public void reset(org.apache.struts.action.ActionMapping mapping,
                  javax.servlet.http.HttpServletRequest request)
Resets action form. This method is called each time request is received. Initialize wizard here if needed, and clear checkboxes.

Parameters:
mapping - The ActionMapping used to select this instance
request - The HTTP request we are processing