Java Reference
In-Depth Information
taskId of 0. The next function copies data from the current item's node to the
next item's node, then returns the first “next” item.
Listing 12.17
WizardItem Object Literal
var root:WizardItem = WizardItem {
node : CustomerAddressControl{}
message : "Enter Address [Step 1 of 4]"
taskId : 0
wizard : bind wizard
next : function(): WizardItem {
var ca = root.node as CustomerAddressControl;
var ship = root.nextItems[0].node as ShipToControl;
if(ship.shipToAddress.name == "" ) {
ship.shipToAddress.name =
ca.customerAddress.name;
ship.shipToAddress.addressLine1 =
ca.customerAddress.addressLine1;
...
}
root.nextItems[0];
}
nextItems : WizardItem {
wizardParent : bind root
....
}
}
The individual wizard items are linked using the nextItems sequence. As
WizardItems are added to the nextItems sequence, each of their wizardParent
variables are set to the containing WizardItem . By setting the parent, this allows
the user to select the Back button to make the wizardParent the current item, in
effect moving backward in the task chain.
In the sequential example depicted in Figure 12.7, the WizardItem task tree is
laid out so that the user first enters the customer address, followed by the ship-
ping address, then the contact information, and finally the shipping date. The
root's nextItems contains the WizardItem for customer address. The customer
address's nextItems contains the WizardItem for the ship to address task, and
so on. This is depicted logically in the following pseudo code listing.
root:"CustomerAddress" ==> nextItems[0]
"Ship To Address" ==> nextItems[0]
"Contact Information" ==> nextItems[0]
"Shipping Date"
 
Search WWH ::




Custom Search