Class MochiKit.Widget.Wizard
Extends
MochiKit.Widget.
The wizard widget class. Used to provide a sequence of
pages, where the user can step forward and backward with
buttons. Internally it uses a <div> HTML element
containing Pane widgets that are hidden and shown according
to the page transitions. In addition to standard HTML events,
the "onchange" event is triggered on page transitions, the
"oncancel" event is triggered if a user cancels an operation,
and the "onclose" event is triggered when the wizard
completes.
Defined in: Widget.js.
Constructor Attributes | Constructor Name and Description |
---|---|
MochiKit.Widget.Wizard(attrs)
Creates a new wizard widget.
|
- Fields borrowed from class MochiKit.Widget:
- _id, Classes
Method Attributes | Method Name and Description |
---|---|
Updates the wizard status indicators, such as the title and the
current buttons.
|
|
activatePage(indexOrPage)
Activates a new page.
|
|
Returns the active page.
|
|
Returns the active page index.
|
|
addChildNode(child)
Adds a single child page widget to this widget.
|
|
cancel()
Cancels the active page operation.
|
|
done()
Sends the wizard onclose signal when the user presses the finish
button.
|
|
Returns an array with all child pane widgets.
|
|
next()
Moves the wizard forward to the next page.
|
|
previous()
Moves the wizard backward to the previous page.
|
|
Resizes the current wizard page.
|
- Methods borrowed from class MochiKit.Widget:
- _animQueueId, _createWidgetTreeElem, _eventHandler, _widgetMixin, addAll, addClass, animate, blurAll, createWidget, createWidgetTree, destroy, destroyWidget, emitSignal, hasClass, hide, isFormField, isHidden, isWidget, removeAll, removeChildNode, removeClass, setAttrs, setStyle, show, toggleClass
Class Detail
MochiKit.Widget.Wizard(attrs)
Creates a new wizard widget.
<Dialog id="exDialog" title="Example Dialog" w="80%" h="50%"> <Wizard id="exWizard" style="width: 100%; height: 100%;"> <Pane pageTitle="The first step"> ... </Pane> <Pane pageTitle="The second step"> ... </Pane> </Wizard> </Dialog>
- Parameters:
- {Object} attrs
- the widget and node attributes
- {Widget} ... Optional
- the child widgets or DOM nodes (should be Pane widgets)
- Returns:
- {Widget} the widget DOM node
Method Detail
_updateStatus()
Updates the wizard status indicators, such as the title and the
current buttons.
activatePage(indexOrPage)
Activates a new page.
- Parameters:
- {Number/Widget} indexOrPage
- the page index or page DOM node
{Widget}
activePage()
Returns the active page.
- Returns:
- {Widget} the active page, or null if no pages have been added
activePageIndex()
Returns the active page index.
- Returns:
- the active page index, or -1 if no page is active
addChildNode(child)
Adds a single child page widget to this widget. The child widget
should be a MochiKit.Widget.Pane widget, or it will be added to a
new one.
- Parameters:
- {Widget} child
- the page widget to add
cancel()
Cancels the active page operation. This method will also reset
the page status of the currently active page to "ANY".
done()
Sends the wizard onclose signal when the user presses the finish
button.
{Array}
getChildNodes()
Returns an array with all child pane widgets. Note that the array
is a real JavaScript array, not a dynamic NodeList.
- Returns:
- {Array} the array of child wizard page widgets
next()
Moves the wizard forward to the next page. The page will not be
changed if the active page fails a validation check.
previous()
Moves the wizard backward to the previous page.
resizeContent()
Resizes the current wizard page. This method need not be called
directly, but is automatically called whenever a parent node is
resized. It optimizes the resize chain by only resizing those DOM
child nodes that are visible.