Class sap.m.WizardModule: sap/m/Wizard

extends Control

The Wizard control enables users to accomplish a single goal which consists of multiple dependable sub-tasks. Each sub-task is provided in the form of a WizardStep.


Since: 1.30.
Constructor Summary
new sap.m.Wizard(sId?, mSettings?)Constructor for a new Wizard.
Event Summary
complete(oControlEvent)The complete event is fired when the user clicks the finish button of the Wizard.
stepActivate(oControlEvent)The StepActivated event is fired every time a new step is activated.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.Wizard.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.Wizard with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.Wizard.getMetadata()Returns a metadata object for class sap.m.Wizard.
addStep(wizardStep)Adds a new step to the Wizard.
attachComplete(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the complete event of this sap.m.Wizard.
attachStepActivate(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the stepActivate event of this sap.m.Wizard.
destroySteps()Destroys all aggregated steps in the Wizard.
detachComplete(fnFunction, oListener)Detaches event handler fnFunction from the complete event of this sap.m.Wizard.
detachStepActivate(fnFunction, oListener)Detaches event handler fnFunction from the stepActivate event of this sap.m.Wizard.
discardProgress(step)Discards all progress done from the given step(incl.
fireComplete(mArguments?)Fires event complete to attached listeners.
fireStepActivate(mArguments?)Fires event stepActivate to attached listeners.
getEnableBranching()Gets current value of property enableBranching.
getFinishButtonText()Returns the finish button text which will be rendered.
getHeight()Gets current value of property height.
getProgress()Returns the number of the last activated step in the Wizard.
getProgressStep()Returns the last activated step in the Wizard.
getShowNextButton()Gets current value of property showNextButton.
getSteps()Gets content of aggregation steps.
getWidth()Gets current value of property width.
goToStep(step, focusFirstStepElement)Goes to the given step.
indexOfStep(oStep)Checks for the provided sap.m.WizardStep in the aggregation steps.
insertStep()Dynamic step insertion is not yet supported.
invalidateStep(step)Invalidates the given step.
nextStep()Validates the current step, and moves one step further.
previousStep()Discards the current step and goes one step back.
removeAllSteps()Removes all steps from the Wizard.
removeStep()Dynamic step removal is not yet supported.
setEnableBranching(bEnableBranching)Sets a new value for property enableBranching.
setFinishButtonText(value)Sets the text for the finish button.
setHeight(sHeight)Sets a new value for property height.
setShowNextButton(value)Sets the visiblity of the next button.
setWidth(sWidth)Sets a new value for property width.
validateStep(step)Validates the given step.
Constructor Detail
new sap.m.Wizard(sId?, mSettings?)
Constructor for a new Wizard.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

  • Properties
  • Aggregations
    • steps : sap.m.WizardStep[] (default)
  • Events
    • stepActivate : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • complete : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
{string}sId? ID for the new control, generated automatically if no ID is given
{object}mSettings? Initial settings for the new control
Event Detail
complete(oControlEvent)
The complete event is fired when the user clicks the finish button of the Wizard. The finish button is only available on the last step of the Wizard.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
stepActivate(oControlEvent)
The StepActivated event is fired every time a new step is activated.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{int}oControlEvent.getParameters.index The index of the activated step as a parameter. One-based.
Method Detail
sap.m.Wizard.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.Wizard with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.m.Wizard.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.Wizard.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addStep(wizardStep): sap.m.Wizard
Adds a new step to the Wizard.
Parameters:
{sap.m.WizardStep}wizardStep New WizardStep to add to the Wizard
Returns:
{sap.m.Wizard} Pointer to the control instance for chaining
attachComplete(oData?, fnFunction, oListener?): sap.m.Wizard
Attaches event handler fnFunction to the complete event of this sap.m.Wizard.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.m.Wizard itself.

The complete event is fired when the user clicks the finish button of the Wizard. The finish button is only available on the last step of the Wizard.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.m.Wizard itself
Returns:
{sap.m.Wizard} Reference to this in order to allow method chaining
attachStepActivate(oData?, fnFunction, oListener?): sap.m.Wizard
Attaches event handler fnFunction to the stepActivate event of this sap.m.Wizard.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.m.Wizard itself.

The StepActivated event is fired every time a new step is activated.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.m.Wizard itself
Returns:
{sap.m.Wizard} Reference to this in order to allow method chaining
destroySteps(): sap.m.Wizard
Destroys all aggregated steps in the Wizard.
Returns:
{sap.m.Wizard} Pointer to the control instance for chaining.
detachComplete(fnFunction, oListener): sap.m.Wizard
Detaches event handler fnFunction from the complete event of this sap.m.Wizard.

The passed function and listener object must match the ones used for event registration.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.m.Wizard} Reference to this in order to allow method chaining
detachStepActivate(fnFunction, oListener): sap.m.Wizard
Detaches event handler fnFunction from the stepActivate event of this sap.m.Wizard.

The passed function and listener object must match the ones used for event registration.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.m.Wizard} Reference to this in order to allow method chaining
discardProgress(step): sap.m.Wizard
Discards all progress done from the given step(incl.) to the end of the wizard. The verified state of the steps is returned to the initial provided.
Parameters:
{sap.m.WizardStep}step The step after which the progress is discarded.
Returns:
{sap.m.Wizard} Pointer to the control instance for chaining.
fireComplete(mArguments?): sap.m.Wizard
Fires event complete to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.Wizard} Reference to this in order to allow method chaining
fireStepActivate(mArguments?): sap.m.Wizard
Fires event stepActivate to attached listeners.

Expects the following event parameters:

  • index of type intThe index of the activated step as a parameter. One-based.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.Wizard} Reference to this in order to allow method chaining
getEnableBranching(): boolean
Gets current value of property enableBranching.

Enables the branching functionality of the Wizard. Branching gives the developer the ability to define multiple routes a user is able to take based on the input in the current step. It is up to the developer to programatically check for what is the input in the current step and set a concrete next step amongs the available subsequent steps. Note: If this property is set to false, next and subSequentSteps associations of the WizardStep control are ignored.

Default value is false.

Returns:
{boolean} Value of property enableBranching
getFinishButtonText(): string
Returns the finish button text which will be rendered.
Returns:
{string} The text which will be rendered in the finish button.
getHeight(): sap.ui.core.CSSSize
Gets current value of property height.

Determines the height of the Wizard.

Default value is 100%.

Returns:
{sap.ui.core.CSSSize} Value of property height
getProgress(): number
Returns the number of the last activated step in the Wizard.
Returns:
{number} The last activated step.
getProgressStep(): sap.m.WizardStep
Returns the last activated step in the Wizard.
Returns:
{sap.m.WizardStep} Pointer to the control instance for chaining.
getShowNextButton(): boolean
Gets current value of property showNextButton.

Controls the visibility of the next button. The developers can choose to control the flow of the steps either through the API (with nextStep and previousStep methods) or let the user click the next button, and control it with validateStep or invalidateStep methods.

Default value is true.

Returns:
{boolean} Value of property showNextButton
getSteps(): sap.m.WizardStep[]
Gets content of aggregation steps.

The wizard steps to be included in the content of the control.

Returns:
{sap.m.WizardStep[]}
getWidth(): sap.ui.core.CSSSize
Gets current value of property width.

Determines the width of the Wizard.

Default value is auto.

Returns:
{sap.ui.core.CSSSize} Value of property width
goToStep(step, focusFirstStepElement): sap.m.Wizard
Goes to the given step.
Parameters:
{sap.m.WizardStep}step The step to go to.
{boolean}focusFirstStepElement Defines whether the focus should be changed to the first element.
Returns:
{sap.m.Wizard} Pointer to the control instance for chaining.
indexOfStep(oStep): int
Checks for the provided sap.m.WizardStep in the aggregation steps. and returns its index if found or -1 otherwise.
Parameters:
{sap.m.WizardStep}oStep The step whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertStep()
Dynamic step insertion is not yet supported.

Experimental API:

Experimental:
invalidateStep(step): sap.m.Wizard
Invalidates the given step.
Parameters:
{sap.m.WizardStep}step The step to be invalidated.
Returns:
{sap.m.Wizard} Pointer to the control instance for chaining.
nextStep(): sap.m.Wizard
Validates the current step, and moves one step further.
Returns:
{sap.m.Wizard} Pointer to the control instance for chaining.
previousStep(): sap.m.Wizard
Discards the current step and goes one step back.
Returns:
{sap.m.Wizard} Pointer to the control instance for chaining.
removeAllSteps(): sap.m.Control
Removes all steps from the Wizard.
Returns:
{sap.m.Control} Pointer to the Steps that were removed.
removeStep()
Dynamic step removal is not yet supported.

Experimental API:

Experimental:
setEnableBranching(bEnableBranching): sap.m.Wizard
Sets a new value for property enableBranching.

Enables the branching functionality of the Wizard. Branching gives the developer the ability to define multiple routes a user is able to take based on the input in the current step. It is up to the developer to programatically check for what is the input in the current step and set a concrete next step amongs the available subsequent steps. Note: If this property is set to false, next and subSequentSteps associations of the WizardStep control are ignored.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Parameters:
{boolean}bEnableBranching New value for property enableBranching
Returns:
{sap.m.Wizard} Reference to this in order to allow method chaining
setFinishButtonText(value): sap.m.Wizard
Sets the text for the finish button. By default it is "Review".
Parameters:
{string}value The text of the finish button.
Returns:
{sap.m.Wizard} Reference to the control instance for chaining.
setHeight(sHeight): sap.m.Wizard
Sets a new value for property height.

Determines the height of the Wizard.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 100%.

Parameters:
{sap.ui.core.CSSSize}sHeight New value for property height
Returns:
{sap.m.Wizard} Reference to this in order to allow method chaining
setShowNextButton(value): sap.m.Wizard
Sets the visiblity of the next button.
Parameters:
{boolean}value True to show the button or false to hide it.
Returns:
{sap.m.Wizard} Reference to the control instance for chaining.
setWidth(sWidth): sap.m.Wizard
Sets a new value for property width.

Determines the width of the Wizard.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is auto.

Parameters:
{sap.ui.core.CSSSize}sWidth New value for property width
Returns:
{sap.m.Wizard} Reference to this in order to allow method chaining
validateStep(step): sap.m.Wizard
Validates the given step.
Parameters:
{sap.m.WizardStep}step The step to be validated.
Returns:
{sap.m.Wizard} Pointer to the control instance for chaining.