## Class TWizard

Description

Implements interfaces:

- INamingContainer

Class TWizard.

TWizard splits a large form and presents the user with a series of smaller forms to complete. TWizard is analogous to the installation wizard commonly used to install software in Windows.

The smaller forms are called wizard steps (TWizardStep, which can be accessed via WizardSteps. In template, wizard steps can be added into a wizard using the following syntax,

       <com:TWizard>
          <com:TWizardStep Title="step 1">
              content in step 1, may contain other controls
          </com:TWizardStep>
          <com:TWizardStep Title="step 2">
              content in step 2, may contain other controls
          </com:TWizardStep>
       </com:TWizard>

Each wizard step can be one of the following types:

- Start : the first step in the wizard.
- Step : the internal steps in the wizard.
- Finish : the last step that allows user interaction.
- Complete : the step that shows a summary to user (no interaction is allowed).
- Auto : the step type is determined by wizard automatically.

At any time, only one step is visible to end-users, which can be obtained by ActiveStep. Its index in the step collection is given by ActiveStepIndex.

Wizard content can be customized in many ways.

The layout of a wizard consists of four parts: header, step content, navigation and side bar. Their content are affected by the following properties, respectively,

- header: HeaderText and HeaderTemplate. If both are present, the latter takes precedence.
- step: WizardSteps.
- navigation: StartNavigationTemplate, StepNavigationTemplate, FinishNavigationTemplate. Default templates will be used if above templates are not set.
- side bar: SideBarTemplate. A default template will be used if this template is not set. Its visibility is toggled by ShowSideBar.

The style of these wizard layout components can be customized via the following style properties,

- header: HeaderStyle.
- step: StepStyle.
- navigation: NavigationStyle, StartNextButtonStyle, StepNextButtonStyle, StepPreviousButtonStyle, FinishPreviousButtonStyle, FinishCompleteButtonStyle, CancelButtonStyle.
- side bar: SideBarStyle and SideBarButtonStyle.

- since: 3.0
- version: $Revision: $ $Date: $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Web/UI/WebControls/TWizard.php (line 84)

    TComponent
       |
       --TApplicationComponent
          |
          --TControl
             |
             --TWebControl
                |
                --TWizard

Class Constant Summary
CMD_CANCEL = 'Cancel'
CMD_COMPLETE = 'Complete'
CMD_MOVETO = 'MoveTo'
CMD_NEXT = 'NextStep'
CMD_PREVIOUS = 'PreviousStep'
ID_SIDEBAR_BUTTON = 'SideBarButton'
ID_SIDEBAR_LIST = 'SideBarList'
ST_AUTO = 'Auto'
ST_COMPLETE = 'Complete'
ST_FINISH = 'Finish'
ST_START = 'Start'
ST_STEP = 'Step'
Method Summary
void addedWizardStep (TWizardStep $step)
void addParsedObject (mixed $object)
boolean allowNavigationToPreviousStep ()
boolean allowNavigationToStep (integer $index)
void applyControlProperties ()
void applyHeaderProperties ()
void applyNavigationProperties ()
void applySideBarProperties ()
void applyStepContentProperties ()
void createChildControls ()
void createFinishNavigation ()
void createHeader ()
void createNavigation ()
void createSideBar ()
void createStartNavigation ()
void createStepContent ()
void createStepNavigation ()
void dataListItemCommand (mixed $sender, TDataListCommandEventParameter $param)
void dataListItemDataBound (mixed $sender, TDataListItemEventParameter $param)
TWizardStep getActiveStep ()
integer getActiveStepIndex ()
TWizardNavigationButtonStyle getCancelButtonStyle ()
string getCancelDestinationUrl ()
TWizardNavigationButtonStyle getFinishCompleteButtonStyle ()
string getFinishDestinationUrl ()
ITemplate getFinishNavigationTemplate ()
TWizardNavigationButtonStyle getFinishPreviousButtonStyle ()
TPanelStyle getHeaderStyle ()
ITemplate getHeaderTemplate ()
string getHeaderText ()
TStack getHistory ()
TMultiView getMultiView ()
TStyle getNavigationButtonStyle ()
TPanelStyle getNavigationStyle ()
void getPreviousStepIndex (boolean $popStack)
boolean getShowCancelButton ()
boolean getShowSideBar ()
TStyle getSideBarButtonStyle ()
TPanelStyle getSideBarStyle ()
ITemplate getSideBarTemplate ()
ITemplate getStartNavigationTemplate ()
TWizardNavigationButtonStyle getStartNextButtonStyle ()
ITemplate getStepNavigationTemplate ()
TWizardNavigationButtonStyle getStepNextButtonStyle ()
TWizardNavigationButtonStyle getStepPreviousButtonStyle ()
TPanelStyle getStepStyle ()
string getStepType (TWizardStep $wizardStep)
string getTagName ()
boolean getUseDefaultLayout ()
TWizardStepCollection getWizardSteps ()
void onActiveStepChanged (TEventParameter $param)
void onBubbleEvent (mixed $sender, TEventParameter $param)
void onCancelButtonClick (TEventParameter $param)
void onCompleteButtonClick (TEventParameter $param)
void onInit (TEventParameter $param)
void onNextButtonClick (TEventParameter $param)
void onPreviousButtonClick (TEventParameter $param)
void onSideBarButtonClick (TEventParameter $param)
void removedWizardStep (TWizardStep $step)
void render (THtmlWriter $writer)
void requiresControlsRecreation ()
void reset ()
void saveState ()
void setActiveStep (TWizardStep $step)
void setActiveStepIndex (integer $value)
void setCancelDestinationUrl (string $value)
void setFinishDestinationUrl (string $value)
void setFinishNavigationTemplate (ITemplate $value)
void setHeaderTemplate (ITemplate $value)
void setHeaderText (string $value)
void setShowCancelButton (boolean $value)
void setShowSideBar (boolean $value)
void setSideBarTemplate (ITemplate $value)
void setStartNavigationTemplate (ITemplate $value)
void setStepNavigationTemplate (ITemplate $value)
void setUseDefaultLayout (boolean $value)
void wizardStepsChanged ()
Methods
addedWizardStep (line 691)

Adds a wizard step to the multiview.

This method should only be used by control developers. It is invoked when a step is added into the step collection of the wizard.

- access: public

void addedWizardStep (TWizardStep $step)

- TWizardStep $step: wizard step to be added into multiview.

addParsedObject (line 190)

Adds TWizardStep objects into step collection.

This method overrides the parent implementation and is invoked when template is being instantiated.

- access: public

void addParsedObject (mixed $object)

- mixed $object: object instantiated in template

Redefinition of:

TControl::addParsedObject()
  Processes an object that is created during parsing template.

allowNavigationToPreviousStep (line 1254)

- return: whether navigation to the previous step is allowed
- access: protected

boolean allowNavigationToPreviousStep ()
allowNavigationToStep (line 1266)

- return: whether navigation to the specified step is allowed
- access: protected

boolean allowNavigationToStep (integer $index)

- integer $index: index of the step

applyControlProperties (line 785)

Applies various properties to the components of wizard

- access: protected

void applyControlProperties ()
applyHeaderProperties (line 796)

Applies properties to the wizard header

- access: protected

void applyHeaderProperties ()
applyNavigationProperties (line 843)

Apply properties to various navigation panels.

- access: protected

void applyNavigationProperties ()
applySideBarProperties (line 810)

Applies properties to the wizard sidebar

- access: protected

void applySideBarProperties ()
applyStepContentProperties (line 834)

Applies properties to the wizard step content

- access: protected

void applyStepContentProperties ()
createChildControls (line 1009)

Creates child controls within the wizard

- access: public

void createChildControls ()

Redefinition of:

TControl::createChildControls()
  Creates child controls.

createFinishNavigation (line 1194)

Creates finish navigation panel.

- access: protected

void createFinishNavigation ()
createHeader (line 1022)

Creates the wizard header.

- access: protected

void createHeader ()
createNavigation (line 1145)

Creates navigation panel.

- access: protected

void createNavigation ()
createSideBar (line 1035)

Creates the wizard side bar

- access: protected

void createSideBar ()
createStartNavigation (line 1170)

Creates start navigation panel.

- access: protected

void createStartNavigation ()
createStepContent (line 1128)

Creates wizard step content.

- access: protected

void createStepContent ()
createStepNavigation (line 1182)

Creates step navigation panel.

- access: protected

void createStepNavigation ()
dataListItemCommand (line 1068)

Event handler for sidebar datalist's OnItemCommand event.

This method is used internally by wizard. It mainly sets the active step index according to the button clicked in the sidebar.

- access: public

void dataListItemCommand (mixed $sender, TDataListCommandEventParameter $param)

- mixed $sender: sender of the event
- TDataListCommandEventParameter $param

dataListItemDataBound (line 1103)

Event handler for sidebar datalist's OnItemDataBound event.

This method is used internally by wizard. It mainly configures the buttons in the sidebar datalist.

- access: public

void dataListItemDataBound (mixed $sender, TDataListItemEventParameter $param)

- mixed $sender: sender of the event
- TDataListItemEventParameter $param

getActiveStep (line 199)

- return: the currently active wizard step
- access: public

TWizardStep getActiveStep ()
getActiveStepIndex (line 218)

- return: the zero-based index of the active wizard step
- access: public

integer getActiveStepIndex ()
getCancelButtonStyle (line 520)

- return: the style for the cancel button
- access: public

TWizardNavigationButtonStyle getCancelButtonStyle ()
getCancelDestinationUrl (line 390)

- return: the URL that the browser will be redirected to if the cancel button in the wizard is clicked. Defaults to ''.
- access: public

string getCancelDestinationUrl ()
getFinishCompleteButtonStyle (line 492)

- return: the style for the complete button in the finish wizard step.
- access: public

TWizardNavigationButtonStyle getFinishCompleteButtonStyle ()
getFinishDestinationUrl (line 408)

- return: the URL that the browser will be redirected to if the wizard finishes. Defaults to ''.
- access: public

string getFinishDestinationUrl ()
getFinishNavigationTemplate (line 322)

- return: navigation template for the finish step. Defaults to null.
- access: public

ITemplate getFinishNavigationTemplate ()
getFinishPreviousButtonStyle (line 506)

- return: the style for the previous button in the start wizard step.
- access: public

TWizardNavigationButtonStyle getFinishPreviousButtonStyle ()
getHeaderStyle (line 547)

- return: the style for the header.
- access: public

TPanelStyle getHeaderStyle ()
getHeaderTemplate (line 339)

- return: template for wizard header. Defaults to null.
- access: public

ITemplate getHeaderTemplate ()
getHeaderText (line 373)

- return: header text. Defaults to ''.
- access: public

string getHeaderText ()
getHistory (line 951)

- return: history containing step indexes that were navigated before
- access: protected

TStack getHistory ()
getMultiView (line 673)

- return: the multiview holding wizard steps
- access: protected

TMultiView getMultiView ()
getNavigationButtonStyle (line 437)

- return: the style common for all navigation buttons.
- access: public

TStyle getNavigationButtonStyle ()
getNavigationStyle (line 573)

- return: the style for the navigation panel.
- access: public

TPanelStyle getNavigationStyle ()
getPreviousStepIndex (line 1222)

Determines the index of the previous step based on history.

- access: protected

void getPreviousStepIndex (boolean $popStack)

- boolean $popStack: whether the first item in the history stack should be popped up after calling this method.

getShowCancelButton (line 255)

- return: whether to display a cancel button in each wizard step. Defaults to false.
- access: public

boolean getShowCancelButton ()
getShowSideBar (line 271)

- return: whether to display a side bar that contains links to wizard steps. Defaults to true.
- access: public

boolean getShowSideBar ()
getSideBarButtonStyle (line 424)

- return: the style for the buttons displayed in the side bar.
- access: public

TStyle getSideBarButtonStyle ()
getSideBarStyle (line 534)

- return: the style for the side bar.
- access: public

TPanelStyle getSideBarStyle ()
getSideBarTemplate (line 356)

- return: template for the side bar. Defaults to null.
- access: public

ITemplate getSideBarTemplate ()
getStartNavigationTemplate (line 288)

- return: navigation template for the start step. Defaults to null.
- access: public

ITemplate getStartNavigationTemplate ()
getStartNextButtonStyle (line 450)

- return: the style for the next button in the start wizard step.
- access: public

TWizardNavigationButtonStyle getStartNextButtonStyle ()
getStepNavigationTemplate (line 305)

- return: navigation template for internal steps. Defaults to null.
- access: public

ITemplate getStepNavigationTemplate ()
getStepNextButtonStyle (line 464)

- return: the style for the next button in each internal wizard step.
- access: public

TWizardNavigationButtonStyle getStepNextButtonStyle ()
getStepPreviousButtonStyle (line 478)

- return: the style for the previous button in the start wizard step.
- access: public

TWizardNavigationButtonStyle getStepPreviousButtonStyle ()
getStepStyle (line 560)

- return: the style for each internal wizard step.
- access: public

TPanelStyle getStepStyle ()
getStepType (line 966)

Determines the type of the specified wizard step.

- return: type of the step, 'Finish', 'Start', 'Step'.
- access: protected

string getStepType (TWizardStep $wizardStep)

- TWizardStep $wizardStep

getTagName (line 179)

- return: tag name for the wizard
- access: protected

string getTagName ()

Redefinition of:

TWebControl::getTagName()
  Returns the tag name used for this control.

getUseDefaultLayout (line 586)

- return: whether to use default layout to arrange side bar and the rest wizard components. Defaults to true.
- access: public

boolean getUseDefaultLayout ()
getWizardSteps (line 245)

- return: collection of wizard steps
- access: public

TWizardStepCollection getWizardSteps ()
onActiveStepChanged (line 607)

Raises OnActiveStepChanged event.

This event is raised when the current visible step is changed in the wizard.

- access: public

void onActiveStepChanged (TEventParameter $param)

- TEventParameter $param: event parameter

onBubbleEvent (line 1282)

Handles bubbled events.

This method mainly translate certain command events into wizard-specific events.

- access: public
- throws: TInvalidDataValueException if a navigation command is associated with an invalid parameter

void onBubbleEvent (mixed $sender, TEventParameter $param)

- mixed $sender: sender of the original command event
- TEventParameter $param: event parameter

Redefinition of:

TControl::onBubbleEvent()
  This method responds to a bubbled event.

onCancelButtonClick (line 618)

Raises OnCancelButtonClick event.

This event is raised when a cancel navigation button is clicked in the current active step.

- access: public

void onCancelButtonClick (TEventParameter $param)

- TEventParameter $param: event parameter

onCompleteButtonClick (line 631)

Raises OnCompleteButtonClick event.

This event is raised when a finish navigation button is clicked in the current active step.

- access: public

void onCompleteButtonClick (TEventParameter $param)

- TEventParameter $param: event parameter

onInit (line 718)

Creates the child controls of the wizard.

This method overrides the parent implementation.

- access: public

void onInit (TEventParameter $param)

- TEventParameter $param: event parameter

Redefinition of:

TControl::onInit()
  This method is invoked when the control enters 'OnInit' stage.

onNextButtonClick (line 644)

Raises OnNextButtonClick event.

This event is raised when a next navigation button is clicked in the current active step.

- access: public

void onNextButtonClick (TEventParameter $param)

- TEventParameter $param: event parameter

onPreviousButtonClick (line 655)

Raises OnPreviousButtonClick event.

This event is raised when a previous navigation button is clicked in the current active step.

- access: public

void onPreviousButtonClick (TEventParameter $param)

- TEventParameter $param: event parameter

onSideBarButtonClick (line 665)

Raises OnSideBarButtonClick event.

This event is raised when a link button in the side bar is clicked.

- access: public

void onSideBarButtonClick (TEventParameter $param)

- TEventParameter $param: event parameter

removedWizardStep (line 706)

Removes a wizard step from the multiview.

This method should only be used by control developers. It is invoked when a step is removed from the step collection of the wizard.

- access: public

void removedWizardStep (TWizardStep $step)

- TWizardStep $step: wizard step to be removed from multiview.

render (line 751)

Renders the wizard.

- access: public

void render (THtmlWriter $writer)

- THtmlWriter $writer

Redefinition of:

TWebControl::render()
  Renders the control.

requiresControlsRecreation (line 741)

Indicates the wizard needs to recreate all child controls.

- access: protected

void requiresControlsRecreation ()
reset (line 993)

Clears up everything within the wizard.

- access: protected

void reset ()
saveState (line 730)

Saves the current active step index into history.

This method is invoked by the framework when the control state is being saved.

- access: public

void saveState ()

Redefinition of:

TControl::saveState()
  This method is invoked when control state is to be saved.

setActiveStep (line 208)

- access: public
- throws: TInvalidOperationException if the step is not in the wizard step collection

void setActiveStep (TWizardStep $step)

- TWizardStep $step: step to be activated

setActiveStepIndex (line 226)

- access: public

void setActiveStepIndex (integer $value)

- integer $value: the zero-based index of the wizard step to be activated

setCancelDestinationUrl (line 399)

- access: public

void setCancelDestinationUrl (string $value)

- string $value: the URL that the browser will be redirected to if the cancel button in the wizard is clicked.

setFinishDestinationUrl (line 416)

- access: public

void setFinishDestinationUrl (string $value)

- string $value: the URL that the browser will be redirected to if the wizard finishes.

setFinishNavigationTemplate (line 330)

- access: public

void setFinishNavigationTemplate (ITemplate $value)

- ITemplate $value: navigation template for the finish step.

setHeaderTemplate (line 347)

- access: public

void setHeaderTemplate (ITemplate $value)

- ITemplate $value: template for wizard header.

setHeaderText (line 381)

- access: public

void setHeaderText (string $value)

- string $value: header text.

setShowCancelButton (line 263)

- access: public

void setShowCancelButton (boolean $value)

- boolean $value: whether to display a cancel button in each wizard step.

setShowSideBar (line 279)

- access: public

void setShowSideBar (boolean $value)

- boolean $value: whether to display a side bar that contains links to wizard steps.

setSideBarTemplate (line 364)

- access: public

void setSideBarTemplate (ITemplate $value)

- ITemplate $value: template for the side bar.

setStartNavigationTemplate (line 296)

- access: public

void setStartNavigationTemplate (ITemplate $value)

- ITemplate $value: navigation template for the start step.

setStepNavigationTemplate (line 313)

- access: public

void setStepNavigationTemplate (ITemplate $value)

- ITemplate $value: navigation template for internal steps.

setUseDefaultLayout (line 596)

- access: public

void setUseDefaultLayout (boolean $value)

- boolean $value: whether to use default layout to arrange side bar and the rest wizard components. If true, an HTML table will be used which places the side bar in the left cell while the rest components in the right cell.

wizardStepsChanged (line 1207)

Updates the sidebar datalist if any.

This method is invoked when any wizard step is changed.

- access: public

void wizardStepsChanged ()

#### Inherited Methods

Inherited From TWebControl

> TWebControl::addAttributesToRender()
> TWebControl::copyBaseAttributes()
> TWebControl::createStyle()
> TWebControl::getAccessKey()
> TWebControl::getBackColor()
> TWebControl::getBorderColor()
> TWebControl::getBorderStyle()
> TWebControl::getBorderWidth()
> TWebControl::getCssClass()
> TWebControl::getFont()
> TWebControl::getForeColor()
> TWebControl::getHasStyle()
> TWebControl::getHeight()
> TWebControl::getStyle()
> TWebControl::getTabIndex()
> TWebControl::getTagName()
> TWebControl::getToolTip()
> TWebControl::getWidth()
> TWebControl::render()
> TWebControl::renderBeginTag()
> TWebControl::renderContents()
> TWebControl::renderEndTag()
> TWebControl::setAccessKey()
> TWebControl::setBackColor()
> TWebControl::setBorderColor()
> TWebControl::setBorderStyle()
> TWebControl::setBorderWidth()
> TWebControl::setCssClass()
> TWebControl::setForeColor()
> TWebControl::setHeight()
> TWebControl::setStyle()
> TWebControl::setTabIndex()
> TWebControl::setToolTip()
> TWebControl::setWidth()

Inherited From TControl

> TControl::__construct()
> TControl::addedControl()
> TControl::addParsedObject()
> TControl::applyStyleSheetSkin()
> TControl::autoBindProperty()
> TControl::autoDataBindProperties()
> TControl::bindProperty()
> TControl::broadcastEvent()
> TControl::broadcastEventInternal()
> TControl::clearChildState()
> TControl::clearControlState()
> TControl::clearNamingContainer()
> TControl::clearViewState()
> TControl::createChildControls()
> TControl::createControlCollection()
> TControl::createdOnTemplate()
> TControl::dataBind()
> TControl::dataBindChildren()
> TControl::dataBindProperties()
> TControl::ensureChildControls()
> TControl::findControl()
> TControl::findControlsByID()
> TControl::findControlsByType()
> TControl::focus()
> TControl::getAdapter()
> TControl::getAllowChildControls()
> TControl::getAttribute()
> TControl::getAttributes()
> TControl::getChildControlsCreated()
> TControl::getClientID()
> TControl::getControls()
> TControl::getControlStage()
> TControl::getControlState()
> TControl::getEnabled()
> TControl::getEnableTheming()
> TControl::getEnableViewState()
> TControl::getHasAdapter()
> TControl::getHasAttributes()
> TControl::getHasControls()
> TControl::getID()
> TControl::getNamingContainer()
> TControl::getPage()
> TControl::getParent()
> TControl::getRegisteredObject()
> TControl::getSkinID()
> TControl::getSourceTemplateControl()
> TControl::getTemplateControl()
> TControl::getUniqueID()
> TControl::getViewState()
> TControl::getVisible()
> TControl::hasAttribute()
> TControl::initRecursive()
> TControl::isDescendentOf()
> TControl::isObjectRegistered()
> TControl::loadRecursive()
> TControl::loadState()
> TControl::loadStateRecursive()
> TControl::onBubbleEvent()
> TControl::onDataBinding()
> TControl::onInit()
> TControl::onLoad()
> TControl::onPreRender()
> TControl::onUnload()
> TControl::preRenderRecursive()
> TControl::raiseBubbleEvent()
> TControl::registerObject()
> TControl::removeAttribute()
> TControl::removedControl()
> TControl::render()
> TControl::renderChildren()
> TControl::renderControl()
> TControl::saveState()
> TControl::saveStateRecursive()
> TControl::setAdapter()
> TControl::setAttribute()
> TControl::setChildControlsCreated()
> TControl::setControlStage()
> TControl::setControlState()
> TControl::setEnabled()
> TControl::setEnableTheming()
> TControl::setEnableViewState()
> TControl::setID()
> TControl::setPage()
> TControl::setSkinID()
> TControl::setTemplateControl()
> TControl::setViewState()
> TControl::setVisible()
> TControl::traverseChildControls()
> TControl::unbindProperty()
> TControl::unloadRecursive()
> TControl::unregisterObject()
> TControl::__get()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

Inherited From TComponent

> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Class Constants
CMD_CANCEL = 'Cancel' (line 99)
CMD_COMPLETE = 'Complete' (line 100)
CMD_MOVETO = 'MoveTo' (line 101)
CMD_NEXT = 'NextStep' (line 98)
CMD_PREVIOUS = 'PreviousStep' (line 97)

Navigation commands.

ID_SIDEBAR_BUTTON = 'SideBarButton' (line 105)

Side bar button ID

ID_SIDEBAR_LIST = 'SideBarList' (line 109)

Side bar data list

ST_AUTO = 'Auto' (line 89)

Wizard step types.

ST_COMPLETE = 'Complete' (line 93)
ST_FINISH = 'Finish' (line 92)
ST_START = 'Start' (line 90)
ST_STEP = 'Step' (line 91)

#### Inherited Constants

Inherited from TControl

Documentation generated on Mon, 01 May 2006 23:05:06 -0400 by phpDocumentor 1.3.0RC4