The wizard framework control enables the user to create wizard
control in a descriptive way via Xml.<p>A wizard let users to perform tasks that otherwise be more complicated and take longer.
Wizard offers:</p>
<ul><li>Simplification when the steps for completing a task are very complex. </li><li>Support when expertise is required. </li><li>Mental relief when the user has to pay attention to large number of associated factors. </li></ul>
<p>A wizard accomplishes these goals by:</p>
<ul><li>Dividing the task to into just a few logical steps. </li><li>Offering the user sensible defaults values for selection. </li><li>Making decision for the user so they can only perform the task in the order of the specified steps. </li></ul>
<h2>Activating the wizard</h2>
<p>The wizard framework is activated by executing the MODAL global function.</p>
<pre>MODAL('core.lib.wizard.htm',{src:'com.sap.mypackage:myWizardPage.xml',...});</pre>
<p>The parameters for the wizard page are:</p>
<table class="VERT"><tr><td class="H V">Param name </td><td class=H>Type </td><td class=H>Description </td></tr><tr><td class=V>src </td><td>String </td><td>(required) Url for wizard definition file. </td></tr><tr><td class=V>width </td><td>Integer </td><td>The width of the wizard window. </td></tr><tr><td class=V>height </td><td>Integer </td><td>The height of the wizard window. </td></tr><tr><td class=V>title </td><td>String </td><td>The title of the wizard window. </td></tr></table>
<h2>Implementation Issues</h2>
<p>You can access the wizard methods and properties by the $WIZ prefix.</p>
<p>In order to implement a wizard you should follow this steps: </p>
<ul><li>Define the wizard pages and the navigation between them, see the next section for the xml definition of a wizard xml. </li><li>For each wizard page implement an appropriate smartform editor in xml format(see <q ref="core.lib:smartform">smartform</q> for How To define an editor in xml format). </li><li>When opening the wizard (via MODAL global functions ) add to the MODAL the src param pointing to the wizard page. </li></ul>
<p>The finish page is the default next page of all the pages that don’t have any NEXTPAGE tag
attached to them, The finish page collects all the data from the pages the user has navigated in.
This action is done automatically if you follow the next steps:</p>
<ul><li>In the smartform xml file, you add a child element called ‘showInSummary’ with the value <code>true</code> to any editor element. </li><li>If the id of the editor element is also a property of the data object of the page. </li></ul>
<h2>Data binding </h2>
<p>Every page has it’s own data object, you can define that data object
in a declarative way via the xml(for details please see the structure of
wizard xml file). This data object is attached automatically to the data
property of the smartform, this enables for data binding of the smartform
to operate correctly on page data object. Please note , that for the data
binding to operate the id of the editor element should be identical for
the property name of the data. </p>
<p>For example:</p>
<pre>
For the following editor definition:
<editor>
.
.
.
<GROUP>
.
<check id="test">
.
.
</check>
</GROUP>
.
.
</editor>
There should be a corresponding page definition:
<PAGE>
<DATA>
<test>true</test>
</DATA>
.
.
.
</PAGE>
</pre>
<h2>Error handling </h2>
<p>Error handling could be done by the following steps:</p>
<ul><li>Gather one or more errors by executing the <code>$WIZ.addError('error</code> description') method. </li><li>Exit from the current trail by executing the <code>$WIZ.abort()</code> method. </li></ul>
<h2>Wizard page definition (XML format)</h2>
<pre>
<WIZARD>
? <CALLBACKS> #Define the callback for the wizard
? <onStart/> #Define a callback function that will be called
at the start up of the wizard
? <onFinish/> #Define a callback function that will be called
at the ending of the wizard
? <onCancel/> #Define a callback function that will be called
when the user press the cancel button
</CALLBACKS>
<PAGE id="1"> #Define the wizard page
<PROPERTIES>
<title/> #Title of the page
<src/> #A url for smartform editor in xml format,
see <q ref="core.lib:smartform">smartform</q>.
? <description/> #Description for the page.
</PROPERTIES>
<DATA> #Define the page data structure.
<child1/> #Child tag name represent the data item name ,
and the value of the child represent the
# default value of the date item
</DATA>
? <CALLBACKS> #Define callback functions for the page.
? <onExit/>
? <onEnter/>
? <onEnterBack/>
? <onExitBack/>
</CALLBACKS>
* <NEXTPAGE id="2" default="[true|false]"/>
#Declare the next pages for the current
page, default attribute is optional
and if absent then the first next page
is the default page.
</PAGE>
</WIZARD>
</pre>(c) SAP AG 2003-2006. All rights reserved.
Defines a wizard page.<h2>Wizard page properties</h2>
<table class="BOTH"><tr><td class="H V">Category </td><td class=H>Type </td><td class=H>Description </td><td class=H>Datatype </td></tr><tr><td class=V>src </td><td>STR </td><td>Gets the url for the xml editor page </td><td>String </td></tr><tr><td class=V>id </td><td>STR </td><td>Gets the uniq id of the page </td><td>String </td></tr><tr><td class=V>title </td><td>STR </td><td>Gets the title of the page </td><td>String </td></tr><tr><td class=V>description </td><td>STR </td><td>Gets the description of the Page </td><td>String </td></tr><tr><td class=V>data </td><td>Object </td><td>Gets or sets the data object of the page </td><td>Varient </td></tr></table>
<h2>Wizard page methods</h2>
<table class="BOTH"><tr><td class="H V">Category </td><td class=H>Type </td><td class=H>Description </td><td class=H>Datatype </td></tr><tr><td class=V>getEditor() </td><td><q ref="core.env:KitEditors!EDITOR_DEF">EDITOR_DEF</q> </td><td>Gets a reference to the attached smartform editor of the page </td><td>N.A. </td></tr><tr><td class=V> </td><td> </td><td> </td><td> </td></tr></table>
Gets the back button.
Gets the cancel button.
Gets the finish button.
Gets the next button.
Gets the Finish Page Id.
Aborts the current trail.The reason that caused the abort action. This message will be displayed to the user.Please make sure that this method is not encapsulates inside
try catch block.
Adds an error to the controller stack.The error message to add.To print and reset the stack
of the Controller use the printErrors method.
Disables The Next, Back and Finish buttons.
Enables The Next, Back and Finish buttons.
Gets a collection of all the pages in the wizard.Return a collection of all the pages of the wizard.
Gets the current page.Return the current page.
Gets an array of all the registered errors in the wizard.An array of errors description.
Gets the main smartform.A reference to the smartform defined in the wizard.
Gets an array of all the pages, which the user has navigated
through.An array of <q ref="core.lib:Wizard!WIZARD_PAGE">WIZARD_PAGE</q> objects.
Gets a collection of all the data from the pages the user has navigated
through, this collection reflects all the data from the data property of the
pages.Returns a property value collection of all
the pages the user has been.If the same property is declared in several pages then
only the value that the last page that assigned that value will be shown.
Prints all the errors that were added by the addError method.
Assigns the next page for the trail.The ID of the page to go to next.