Table of contents
- 1. Examples
- 2. Attributes
- 3. Properties
- 4. Methods
- 5. Related
This element is used to construct a step-by-step wizard found in some applications to guide users through a task. It is used for a window with several steps contained on several pages. This element provides the header and buttons along the bottom, and also handles navigation between the pages. Each page should be constructed using a wizardpage
. The pages are displayed in the order that they are placed in the wizard, unless you use the next
and pageid
attributes on the pages to change the sequence. The wizard will rendered in a manner suitable for the user's selected theme and platform. In newer versions of Mozilla, a statusbar
may be placed directly inside the wizard element which will be shared among all pages.
More information is available in the XUL tutorial.
- Attributes
- firstpage , lastpage , onextra1 , onextra2 , onwizardback , onwizardcancel , onwizardfinish , onwizardnext , pagestep , title , windowtype
- Properties
- canAdvance , canRewind , currentPage , onFirstPage , onLastPage , pageCount , pageIndex , pageStep , title , wizardPages
Examples
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<wizard id="theWizard" title="Secret Code Wizard"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script>
function checkCode(){
document.getElementById('theWizard').canAdvance = (document.getElementById('secretCode').value == "cabbage");
}
</script>
<wizardpage onpageshow="checkCode();">
<label value="Enter the secret code:"/>
<textbox id="secretCode" onkeyup="checkCode();"/>
</wizardpage>
<wizardpage>
<label value="That is the correct secret code."/>
</wizardpage>
</wizard>
Attributes
Inherited from XUL element
align
, allowevents
, allownegativeassertions
, class
, coalesceduplicatearcs
, collapsed
, container
, containment
, context
,
, datasources
, dir
, empty
, equalsize
, flags
, flex
, height
,
, id
, insertafter
, insertbefore
, left
, maxheight
, maxwidth
,
, minheight
, minwidth
, mousethrough
, noinitialfocus
, observes
, ordinal
, orient
, pack
, persist
, popup
, position
, preference-editable
, querytype
, ref
, removeelement
, sortDirection
, sortResource
, sortResource2
, statustext
, style
, template
, tooltip
, tooltiptext
, top
, uri
, wait-cursor
, width
activetitlebarcolor
New in Firefox 3
inactivetitlebarcolor
New in Firefox 3
onextra1
onextra2
onwizardback
true to allow the previous page to be displayed and false to disallow moving back a page. Use the canRewind
property to indicate to the user (by disabling the Back button) that they cannot go back a page. onwizardcancel
true to allow the wizard to be cancelled, and close the wizard, or return false to prevent the wizard from being cancelled. onwizardfinish
true to allow the wizard to be closed, accepting any values entered on the pages, or return false to prevent the wizard from being closed. Use the canAdvance
property to indicate to the user (by disabling the Finish button) that they cannot end the wizard. onwizardnext
true to allow the next page to be displayed and false to disallow moving to the next page. Use the canAdvance
property to indicate to the user (by disabling the Next button) that they cannot go to the next page. pagestep
title
windowtype
Properties
Inherited Properties
align
,
attributes, allowEvents
,
baseURI, boxObject
, builder
,
childElementCount,
childNodes,
children, className
,
clientHeight,
clientLeft,
clientTop,
clientWidth, collapsed
, contextMenu
, controllers
, database
, datasources
, dir
,
firstChild,
firstElementChild, flex
, height
, hidden
, id
,
lastChild,
lastElementChild, left
,
localName, maxHeight
, maxWidth
, menu
, minHeight
, minWidth
,
namespaceURI,
nextElementSibling,
nextSibling,
nodeName,
nodeType,
nodeValue, observes
, ordinal
, orient
,
ownerDocument, pack
,
parentNode, persist
,
prefix,
previousElementSibling,
previousSibling, ref
, resource
,
scrollHeight,
scrollLeft,
scrollTop,
scrollWidth, statusText
, style
,
tagName,
textContent, tooltip
, tooltipText
, top
, width
canAdvance
true if the user can press the Next button to go to the next page. If this property is false, the user cannot navigate to the next page. Set this property to true to indicate that the user can go to the next page. Set to false to disallow moving to the next page. This has the effect of enabling or disabling the Next button, or, on the last page of the wizard, the Finish button. canRewind
true if the user can press the Back button to go to the previous page. If this property is false, the user cannot navigate to the previous page. Set this property to true to indicate that the user can go back a page. Set to false to disallow moving to the previous page. This has the effect of enabling or disabling the Back button. currentPage
wizardpage
element wizardpage
element that is currently displayed. You can modify this value to change the current page. onFirstPage
true if the user is on the first page, which may or may not be the first index. onLastPage
true if the user is on the last page of the wizard. pageIndex
pageStep
pageIndex
, because pages are not necessarily navigated in order. wizardPages
wizardpage
elements wizardpage
elements in the wizard
.
Methods
-
advance( pageID ) - Return type: no return value
- Call this method to go to the next page. This is equivalent to pressing the Next button. The
canAdvanceproperty must be set totruefor the page to be changed. The code in theonwizardnextattribute is called before the page is changed. The pageID argument allows you to specify the index of the page to which to jump. Supplynullas the argument to go to the next page in the sequence.
-
cancel() - Return type: no return value
- Call this method to cancel and close the wizard. The code in the
attribute is called before the wizard is cancelled.onwizardcancel
-
extra1() - Return type: no return value
- Call this method to simulate clicking the extra1 button. The code in the
onextra1attribute is called.
-
extra2() - Return type: no return value
- Call this method to simulate clicking the extra2 button. The code in the
onextra2attribute is called.
-
getButton( type ) - Return type: button element
- Returns the
buttonelement in the dialog corresponding to the given type.
-
getPageById( pageID ) - Return type:
wizardpageelement - Returns the
wizardpageelement corresponding to the specified pageID.
-
goTo( pageID ) - Return type: no return value
- This method is used to change which page is currently displayed, specified by the pageID argument. The page will be changed regardless of the value of
canAdvanceorcanRewind. Theonwizardbackandonwizardnextcode is not called when using this function.
-
rewind() - Return type: no return value
- Call this method to go back a page. It is equivalent to pressing the Back button. The
canRewindproperty must be set totruefor the page to be changed. The code in theonwizardbackattribute is called before the page is changed.
Mozilla Developer Network