\FormExtraMulti
FormExtraMulti
Multi step form
- Define a class name with a number in it (MyFormStep1)
- Call definePrevNextActions instead of defining your actions
- Define a name in getStepTitle for a nicer name
- In your controller, create the form with classForCurrentStep
- Author: lekoala
Synopsis
class FormExtraMulti
extends FormExtra
{
- // Inherited constants from FormExtra
- const MSG_NOTICE = 'notice';
- const MSG_WARNING = 'warning';
- const MSG_BAD = 'bad';
- const MSG_GOOD = 'good';
- // Inherited members from FormExtra
- protected boolean $keepSessionAlive;
- protected boolean $dataLossWarning;
- protected $dataLossMessage;
- // methods
- public void FormAction()
- public static string classNameWithoutNumber()
- public static string classNameNumber()
- public static string classForCurrentStep()
- public ArrayList AllSteps()
- public static void clearCurrentStep()
- public static int getCurrentStep()
- public static string setMaxStep()
- public static int getMaxStep()
- public static string setCurrentStep()
- public static string incrementStep()
- public static bool isLastStep()
- public static string decrementStep()
- public static string getStepTitle()
- public void checkAccessAction()
- public SS_HTTPResponse gotoStep()
- public SS_HTTPResponse doSave()
- public SS_HTTPResponse doPrev()
- public SS_HTTPResponse doNext()
- protected FieldList definePrevNextActions()
- protected FieldList definePrevNextSaveActions()
- public static void getDataFromStep()
- public void saveDataInSession()
- public void getDataFromSession()
- public void clearDataFromSession()
- public void clearAllDataFromSession()
- // Inherited methods from FormExtra
- public void __construct()
- public void forTemplate()
- public void storeBackURL()
- public void getKeepSessionAlive()
- public void setKeepSessionAlive()
- public void getDataLossWarning()
- public void setDataLossWarning()
- public void getDataLossMessage()
- public void setDataLossMessage()
- public void setControllerMessage()
- public void getSessionKey()
- public void saveDataInSession()
- public void clearDataFromSession()
- public void getDataFromSession()
- public void restoreDataFromSession()
- protected SS_HTTPResponse err()
- protected SS_HTTPResponse success()
- protected SS_HTTPResponse msg()
- public ZenValidator getValidator()
Hierarchy
Extends
Constants
Name | Value |
---|---|
MSG_NOTICE | 'notice' |
MSG_WARNING | 'warning' |
MSG_BAD | 'bad' |
MSG_GOOD | 'good' |
Members
protected
- $dataLossMessage
- $dataLossWarning
- $keepSessionAlive
Methods
protected
- definePrevNextActions() — Call this instead of manually creating your actions
- definePrevNextSaveActions() — Same as definePrevNext + a save button
public
- AllSteps() — Get all steps as an ArrayList. To be used for your templates.
- FormAction()
- checkAccessAction()
- classForCurrentStep() — Get class name for current step based on this class name
- classNameNumber() — Get number from class name
- classNameWithoutNumber() — Get class name without any number in it
- clearAllDataFromSession() — Clear all infos stored in the session from all steps
- clearCurrentStep() — Clear current step
- clearDataFromSession()
- decrementStep() — Decrement step
- doNext() — A basic next action that increments the current step and save the data to the session
- doPrev() — A basic previous action that decrements the current step
- doSave() — A basic save action that saves the current step
- getCurrentStep() — Get current step (defined in session). 0 if not started yet.
- getDataFromSession()
- getDataFromStep()
- getMaxStep() — Get max step (defined in session). 0 if not started yet.
- getStepTitle() — Return the step name
- gotoStep() — Goto a step
- incrementStep() — Increment step
- isLastStep() — Check if this is the last step
- saveDataInSession()
- setCurrentStep() — Set current step
- setMaxStep() — Set max step
Inherited from FormExtra
protected
- err() — Shortcut for an error
- msg() — Return a response with a message for your form
- success() — Shortcut for a success
public
- clearDataFromSession()
- forTemplate()
- getDataFromSession()
- getDataLossMessage()
- getDataLossWarning()
- getKeepSessionAlive()
- getSessionKey()
- getValidator()
- restoreDataFromSession()
- saveDataInSession()
- setControllerMessage() — Set a message on the controller. Useful is the form is not displayed in the redirected page
- setDataLossMessage()
- setDataLossWarning()
- setKeepSessionAlive() — Define if we want to have a little js script that pings Security/ping
- storeBackURL()