Show TOC

Background documentationData Model Locate this document in the navigation structure

 

The data that is entered by an administrator in a wizard is generally kept in the wizard data model, a set of key-value pairs stored in the wizard context. The data model provides a way to keep wizard data so that it is accessible to all wizard panes.

Another key advantage of keeping the wizard's data in the data model is that the wizard framework can automatically store values entered in a UI control in the data model, and can automatically load into UI controls values set in the data model.

This synchronization - between data model and UI control - can only be done with wizard framework UI controls, which are part of the com.sapportals.admin.wizardframework.components package. These controls are based on HTMLB controls.

The wizard context is provided as an IWizardContext parameter in key methods of the wizard framework. For example, in setupPane() of a particular pane, the wizard context is supplied, as shown in the method's signature:

Syntax Syntax

  1. protected void setupPane(IWizardContext ctx, FlowContainer pane) {
    }
    
End of the code.

You can retrieve values from the data model and alter the user interface based on the values.

Wizard Framework Components

Wizard framework components are used to synchronize a data model item with a user interface control. The following are the available controls:

  • CheckboxChoiceComponent

  • CheckboxSelectionComponent

  • DropdownSelectionComponent

  • Group

  • HTMLScriptComponent

  • ListDisplayComponent

  • ListSelectionComponent

  • MultilineInputComponent

  • MultiSelectionComponent

  • ProgressBarComponent

  • RadioButtonSelectionComponent

  • TextInputComponent

  • TableViewComponent

The components are all part of the com.sapportals.admin.wizardframework.components package.

To synchronize a UI control with a specific item in the data model, call setValueTargetpath() on the control and pass the name of the data model item that will store the control's value.

For example, the following creates an input field called Last Name, whose value is associated with the data model item details.lastName.

Syntax Syntax

  1. TextInputComponent firstName = new TextInputComponent("Last Name");
    firstName.setValueTargetPath("details.lastName");
    
End of the code.
Dependencies

You may want to erase specific data model items when the value for another item changes. You can set up this dependency by calling addDependency() on the IConfigurableWizard object and supplying the source and target data model items. This is done in setupWizard() of the AbstractWizard object.

The following causes all items with the string prefix of the value in AddressPane.ADDRESS_PANE_KEY to be erased whenever the last_name item is changed:

Syntax Syntax

  1. wizard.addDependency("last_name", AddressPane.ADDRESS_PANE_KEY);
End of the code.