Creating an action using the XPath EditorAdded by IBM on May 2, 2012 | Version 1 (Original)
|In this example, an XPath expression is used to automatically duplicate the shipping address as the billing address. This example requires the use of the AdvancedIBM® Forms Designer perspective.
In this example, an XPath expression is used to automatically duplicate the shipping address as the billing address. This example requires the use of the AdvancedIBM
® Forms Designer perspective.
To open the Advanced IBM
Forms Designer perspective go to Window
-> Open Perspective
-> Advanced IBM Forms Designer
- To create the shipping information click Text Label and drop it into the form.
The Properties window opens.
Tip: The first field in the Properties window, located above the tabs, is the unique identifier for the page, called a SID. The SID is displayed in the Outline view. To more easily differentiate the various fields and labels, the SID is changeable to a more relevant term. For example, the SID of LABEL1 can be changed to ShipName. When building the form, consider changing the SIDs, but remember each SID on a page must be unique.
- In the Text: area type Name. Click OK to close the Properties window.
- Add a second text label. When the Properties window opens, change its Text: to Shipping Address.
Align the two labels one beneath the other.
- Click Entry Field and drop it into the form to the right of the Name label.
No changes are required to the Properties window. Click OK to close it. Add a second Entry Field to the right of the Shipping Address label.
Repeat steps 2 - 5 to add text labels and entry fields for billing information on the first page.
- ClickPage Navigation and click a spot on the form.
In the Properties window, change the Text: to Next and click OK to close the Properties window.
- Select Check from the Palette and drop it onto the form. No changes are required to the Properties window, so click OK to close it.
- Click Text Label and drop it onto the form to the right of the Check box. Change the Text: to Use Shipping Address as Billing Address. and click OK to close the Properties window.
- Click PAGE2 from the Outline view. Repeat steps 2 - 5 to add billing and shipping labels and fields to the form.
- Click Page Navigation and click a spot on the form.
In the Properties window, select Previous from the Navigate to page: dropdown menu and change the Text: to Previous. Click OK to close the Properties window.
Now that the basic form is built, set the action using the XPath Editor.
- Double-click on Billing Address Name to open the Properties window. Go to Data -> Change Data Element.
The XPath Editor opens.
- Highlight and delete the information displayed in the Action Editor window. Click Function -> boolean -> choice.
The choice menu opens.
- In the boolean parameter, click Data Element. Expand the data tree until the check1 is visible. Select check1 and click OK.
Alternatively, move the XPath Editor | Data Element window so the check box is visible and select the item directly from the form.
- Select equal to (=) from the Operation menu.
- Select true from the String menu.
This completes the condition.
- Click object1 and delete the single quotes. Click Data Element and select the Billing Address Name field on the second page.
- Click object2 and delete the single quotes. Click Data Element and select the Shipping Address Name field on the second page.
- Click OK to close all windows and set the action.
Repeat steps 14 - 21 for the remaining entry fields.
Click the Viewer
tab to test the action. Enter characters into the Name and Shipping Address fields. Click the checkbox and the information is duplicated. Click the Next
page navigation button to go to the second page. The information from the first page will be displayed in the fields on the second page.
Parent topic: XPath Editor