System.Web.UI.WebControls
[ class tree: System.Web.UI.WebControls ] [ index: System.Web.UI.WebControls ] [ all elements ]

Class: TWizard

Source Location: /Web/UI/WebControls/TWizard.php

Class Overview

TComponent
   |
   --TControl
      |
      --TWebControl
         |
         --TPanel
            |
            --TWizard

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

Class Details

[line 104]
TWizard splits a large form and present the user with a series of smaller form to complete. The TWizard is analogous to the installation wizard commonly used to install software in Windows.

TWizard centralizes the required events to manipulate the flow of the form. It also renders the appropriate step along with the navigation elements. The wizard allows the steps to be presented linearly or otherwise in a nonlinear fashion. That is, the forms can be filled sequentially or if permitted allowed the user to choose which ever step he/she wishes. In addition, the steps can be programmed to be skipped or repeated.

A simple example of 3 steps.

  1. <com:TWizard ID="ContactWizard" >
  2. <com:TWizardStep Title="Step 1: Name">
  3. <com:TFormLabel For="Name">Full name:</com:TFormLabel>
  4. <com:TTextBox ID="Name" />
  5. </com:TWizardStep>
  6. <com:TWizardStep Title="Step 2: Contact">
  7. <com:TFormLabel For="Phone">Telephone Number:</com:TFormLabel>
  8. <com:TTextBox ID="Phone" />
  9. <com:TFormLabel For="Email">Email:</com:TFormLabel>
  10. <com:TTextBox ID="Email" />
  11. </com:TWizardStep>
  12. <com:TWizardStep Title="Step 3: Confirmation">
  13. <table><tr><th>Name:</th>
  14. <td><%= $this->Page->ContactWizard->Name->Text %></td>
  15. </tr><tr><th>Phone:</th>
  16. <td><%= $this->Page->ContactWizard->Phone->Text %></td>
  17. </tr><tr><th>Email:</th>
  18. <td><%= $this->Page->ContactWizard->Email->Text %></td>
  19. </tr></table>
  20. </com:TWizardStep>
  21. </com:TWizard>

TWizard also intercepts the following bubbled events. E.g TButton has CommandName and CommandParameter properties that bubbles as "OnBubbleEvent". The following are the supported bubble event names and how TWizard handles them.

Bubble Events

  • next, TWizard fires OnNextCommand event.
  • previous, TWizard fires OnPreviousCommand event.
  • finish, TWizard fires OnFinishCommand event.
  • cancel, TWizard fires OnCancelCommand event.
  • jumpto, TWizard fires OnJumpToCommand event. jumpto requires a parameter, the destination step.
E.g. anywhere within the TWizard, a button like the following
  1. <com:TButton CommandName="jumpto" CommandParameter="2" />
when click will bubble to TWizard and in turn fires the OnJumpToCommand with parameter value of "2".

Namespace: System.Web.UI.WebControls

Properties

  • ActiveStep, TWizardStep,
    Gets the current active step.
  • ActiveStepIndex, integer,
    Gets or sets the active step specified by a zero-starting index.
  • DisplaySideBar, boolean
    isSideBarVisible or setDisplaySideBar, show or hides the side bar.
  • FinishStepButtonText, string
    Gets or sets the string for the "Finish" button.
  • NextStepButtonText, string
    Gets or sets the string for the "Next" button.
  • PreviousStepButtonText, string
    Gets or sets the string for the "Previous" button.
  • CancelButtonText, string
    Gets or sets the string for the "Cancel" button.
Events
  • OnStepChanged Occurs when the step is changed.
  • OnCancelCommand Occurs when the "Cancel" button is pressed.
  • OnFinishCommand Occurs when the "Finish" button is pressed.
  • OnNextCommand Occurs when the "Next" button is pressed.
  • OnPreviousCommand Occurs when the "Previous" button is pressed.
  • OnJumpToCommand Occurs when the "JumpTo" button is pressed.




version:  v1.0, last update on Sat Dec 11 15:25:11 EST 2004
author:  Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>


[ Top ]

Constants

Methods


Inherited Variables

Inherited Methods

Class: TPanel

TPanel::__construct()
TPanel::getAttributesToRender()
This overrides the parent implementation by rendering more TPanel-specific attributes.
TPanel::getBackImageUrl()
TPanel::getHorizontalAlign()
TPanel::isWrap()
TPanel::setBackImageUrl()
Sets the URL of the background image for the panel component.
TPanel::setHorizontalAlign()
Sets the horizontal alignment of the contents within the panel.
TPanel::setWrap()
Sets the value indicating whether the content wraps within the panel.

Class: TWebControl

TWebControl::appendJavascriptEvent()
Append a javascript statement to a particular attribute, e.g. "onclick".
TWebControl::getAccessKey()
TWebControl::getAttributesToRender()
This overrides the parent implementation by rendering more TWebControl-specific attributes.
TWebControl::getBackColor()
TWebControl::getBorderColor()
TWebControl::getBorderStyle()
TWebControl::getBorderWidth()
TWebControl::getCssClass()
TWebControl::getForeColor()
TWebControl::getHeight()
TWebControl::getJavascriptEvents()
Get the list of all the javascript statements.
TWebControl::getStyle()
TWebControl::getTabIndex()
TWebControl::getToolTip()
TWebControl::getWidth()
TWebControl::isEnabled()
TWebControl::parseStyle()
Parses a CSS style string into an array representation.
TWebControl::removeJavascriptEvent()
Remove all or a particular javascript statements.
TWebControl::setAccessKey()
Sets the access key of the control.
TWebControl::setBackColor()
Sets the background color of the control
TWebControl::setBorderColor()
Sets the border color of the control
TWebControl::setBorderStyle()
Sets the border style of the control
TWebControl::setBorderWidth()
Sets the border width of the control
TWebControl::setCssClass()
Sets the CSS class name of the control
TWebControl::setEnabled()
Enables or disables a control.
TWebControl::setForeColor()
Sets the foreground color of the control
TWebControl::setHeight()
Sets the height of the control
TWebControl::setStyle()
Sets the CSS style of the control.
TWebControl::setTabIndex()
Sets the tab index of the control.
TWebControl::setToolTip()
Sets the tooltip of the control.
TWebControl::setWidth()
Sets the width of the control

Class: TControl

TControl::__construct()
Constructor.
TControl::addBody()
Appends an object into the body collection of this control.
TControl::addParsedObject()
Adds the object parsed in template as a body of the component.
TControl::allowBody()
Determines whether the control can add the object as a body.
TControl::clearViewState()
Clears viewstate
TControl::findBodyControl()
TControl::getAttribute()
TControl::getAttributes()
Returns the attribute list object.
TControl::getAttributesToRender()
Returns attributes to be rendered.
TControl::getBodies()
TControl::getClientID()
Returns the client ID of the component.
TControl::getContainer()
Returns the container of this component.
TControl::getSkinName()
TControl::getTagName()
TControl::getViewState()
Returns a viewstate value.
TControl::initSkin()
Initializes a skin for the control. If a skin name is provided then that skin will be loaded.
TControl::isViewStateEnabled()
TControl::isVisible()
This method checks whether a control is visible.
TControl::loadViewState()
Loads viewstate into this component and its children.
TControl::onBubbleEvent()
This method responds to a bubbled event.
TControl::onInit()
This method is invoked when the control enters 'Init' stage.
TControl::onInitRecursive()
Calls onInit of this control and its children recursively.
TControl::onLoad()
This method is invoked when the control enters 'Load' stage.
TControl::onLoadRecursive()
Calls onLoad of this control and its children recursively.
TControl::onPreRender()
This method is invoked when the control enters 'PreRender' stage.
TControl::onPreRenderRecursive()
Calls onPreRender of this control and its children recursively.
TControl::onUnload()
This method is invoked when the control enters 'Unload' stage.
TControl::onUnloadRecursive()
Calls onUnload of this control and its children recursively.
TControl::raiseBubbleEvent()
Invokes the parent's onBubbleEvent method.
TControl::removeBodies()
Removes all body content.
TControl::render()
Renders this control.
TControl::renderAttributes()
Renders the attributes.
TControl::renderBody()
Renders the body content.
TControl::saveViewState()
Returns the viewstate of this component and its children.
TControl::setAttribute()
Sets an attribute.
TControl::setContainer()
Sets the container of this component
TControl::setEnableViewState()
TControl::setSkinName()
Sets the skin to use for this control
TControl::setTagName()
Sets the tag name.
TControl::setViewState()
Sets a viewstate value.
TControl::setVisible()
TControl::synchronizeControl()
This method should only be used by framework developer.

Class: TComponent

TComponent::__construct()
Constructor.
TComponent::addChild()
Adds a child component.
TComponent::addParsedObject()
Handles a component or string met in template.
TComponent::attachEventHandler()
Attaches a handler function to an event.
TComponent::bindProperty()
Sets up the binding between a property and an expression.
TComponent::canGetProperty()
Determines whether a property can be read.
TComponent::canSetProperty()
Determines whether a property can be written.
TComponent::createComponent()
Creates a child component.
TComponent::dataBind()
Performs the databinding for this component.
TComponent::evaluateExpression()
Evaluates a PHP expression.
TComponent::evaluateStatements()
Evaluates a list of PHP statements.
TComponent::findObject()
Finds an object by its ID path.
TComponent::getApplication()
TComponent::getChild()
TComponent::getChildren()
TComponent::getDefinition()
Returns or builds a component definition.
TComponent::getGlobalization()
Returns the Globalization instance for the application.
TComponent::getID()
TComponent::getModule()
Returns the module object that contains the component or the page containing the component.
TComponent::getPage()
TComponent::getParent()
TComponent::getPropertyInitValue()
Gets the initial value of a property.
TComponent::getPropertyType()
Returns the type of a property
TComponent::getRequest()
Returns the request object associated with application.
TComponent::getServiceManager()
Returns the service manager for this application.
TComponent::getSession()
Returns the session object associated with the application.
TComponent::getSessionState()
Returns a session variable.
TComponent::getUniqueID()
Returns the unique ID of the component.
TComponent::getUser()
Returns the user object associated with the application.
TComponent::hasChildren()
TComponent::hasEvent()
Determines whether an event is defined.
TComponent::hasProperty()
Determines whether a property is defined.
TComponent::initProperties()
Initializes the property values.
TComponent::instantiateTemplate()
Parses a template string and instantiates the content.
TComponent::onDataBinding()
This method is invoked when dataBind is invoked for the component.
TComponent::raiseEvent()
Invokes all attached event handler functions for a particular event.
TComponent::removeChild()
Removes a child component.
TComponent::removeChildren()
Removes all child components.
TComponent::setAttribute()
Sets an attribute.
TComponent::setDefinition()
Sets a component definition.
TComponent::setID()
Sets a component ID.
TComponent::setParent()
Sets the parent of this component.
TComponent::setPropertyInitValue()
Sets the initial value of a property.
TComponent::setRoot()
Sets the root component in the component hierarchy.
TComponent::setSessionState()
Sets a session variable.
TComponent::unbindProperty()
Breaks the binding between a property and an expression.
TComponent::__get()
Returns a property value by name or a child component by ID.
TComponent::__set()
Sets value of a component property.

Class Methods


method addParsedObject [line 283]

void addParsedObject( object a $object, object the $context)

Override the parent implementation.

It adds any components that are instance of TWizardStep or TWizardTemplate as a child and body of the TWizard. Other components are handled by the parent. By adding components as child of TWizard, these component's parent is the TWizard.




access:  public


Overrides TControl::addParsedObject() (Adds the object parsed in template as a body of the component.)

Parameters:

object a   $object   component object.
object the   $context   template owner object

[ Top ]

method getActiveStep [line 249]

TWizardStep getActiveStep( )

Get the current step. null if the ActiveStepIndex is not valid.



access:  public


[ Top ]

method getActiveStepIndex [line 269]

int getActiveStepIndex( )

Get the current step index.



return:  current step index.
access:  public


[ Top ]

method getCancelButtonText [line 222]

string getCancelButtonText( )

Get the Cancel button text.



return:  button text.
access:  public


[ Top ]

method getFinishStepButtonText [line 167]

string getFinishStepButtonText( )

Get the Finish button text.



return:  button text.
access:  public


[ Top ]

method getNextStepButtonText [line 186]

string getNextStepButtonText( )

Get the Next button text.



return:  button text.
access:  public


[ Top ]

method getPreviousStepButtonText [line 204]

string getPreviousStepButtonText( )

Get the Previous button text.



return:  button text.
access:  public


[ Top ]

method isSideBarVisible [line 240]

boolean isSideBarVisible( )

Determine if the side bar's visibility.



return:  true if visible, false otherwise.
access:  public


[ Top ]

method onBubbleEvent [line 493]

void onBubbleEvent( TComponent $sender, TEventParameter $param)

This method responds to a bubbled event. It will capture the event

and fire the appropriate events, e.g. OnNextCommand if the parameter event name is "next". After the command event, a step changed event (OnStepChanged) is fire unless the event parameter variable $cancel is set to true.




access:  protected


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

Parameters:

TComponent   $sender   sender of the event
TEventParameter   $param   event parameters

[ Top ]

method onLoad [line 308]

void onLoad( TEventParameter $param)

Initalize and add the default navigation templates. Add the side bar if required.



access:  protected


Overrides TControl::onLoad() (This method is invoked when the control enters 'Load' stage.)

Parameters:

TEventParameter   $param   event parameter to be passed to the event handlers

[ Top ]

method onPreRender [line 322]

void onPreRender( TEventParameter $param)

Determins which wizard step to show and appropriate navigation elements.



access:  protected


Overrides TControl::onPreRender() (This method is invoked when the control enters 'PreRender' stage.)

Parameters:

TEventParameter   $param   event parameter to be passed to the event handlers

[ Top ]

method setActiveStepIndex [line 260]

void setActiveStepIndex( int $index)

Set the active step index. This determines which step to show.



access:  public


Parameters:

int   $index   the current step to show.

[ Top ]

method setCancelButtonText [line 213]

void setCancelButtonText( string $value)

Set the Cancel button text.



access:  public


Parameters:

string   $value   button text

[ Top ]

method setDisplaySideBar [line 231]

void setDisplaySideBar( boolean $value)

Show or hide the side bar.



access:  public


Parameters:

boolean   $value   true to show the side bar, false hides it.

[ Top ]

method setFinishStepButtonText [line 158]

void setFinishStepButtonText( string $value)

Set the Finish button text.



access:  public


Parameters:

string   $value   button text

[ Top ]

method setNextStepButtonText [line 176]

void setNextStepButtonText( string $value)

Set the Next button text.



access:  public


Parameters:

string   $value   button text

[ Top ]

method setPreviousStepButtonText [line 195]

void setPreviousStepButtonText( string $value)

Set the Previous button text.



access:  public


Parameters:

string   $value   button text

[ Top ]


Class Constants

CMD_CANCEL =  'cancel'

[line 128]

The command name for the OnCancelCommand.


[ Top ]

CMD_FINISH =  'finish'

[line 122]

The command name for the OnFinishCommand.


[ Top ]

CMD_JUMP =  'jumpto'

[line 134]

The command name for the OnJumpToCommand.


[ Top ]

CMD_NEXT =  'next'

[line 110]

The command name for the OnNextCommand.


[ Top ]

CMD_PREVIOUS =  'previous'

[line 116]

The command name for the OnPreviousCommand.


[ Top ]



© 2004-2005 PRADO Software Group. All Rights Reserved.