Binding connects presentation items to data elements. The bind defines what information the data element displays. In this example, entry fields on two pages are bound together so data is displayed on the second page of the form when the user enters it on the first.
Binding data elements is used to display user-entered data in several places, or using different presentation items. For example, the user may enter an account number on the first page which is then displayed as a read-only label on each subsequent page. Another example of binding is showing a list or radio group of options to the user. Once the user makes a choice from the list or radio group, the choice is displayed in a label on additional form pages. The example below displays how fields on separate pages are bound so user entered information appears on the second page after it is entered on the first page.
- First, add a second page to the form. Click Page from the Palette and drop it onto the form
The second page appears in the Outline view and focus is on the second page. Return to the first page by clicking PAGE1 in the Outline view.
Add shipping information form items to the first page using the steps below:
- 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 and the SID of LABEL3 can be changed to BillName. 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 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 the Billing Address 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.
- 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 form is built, map the fields on the first page to the fields on the second. Once mapped, the user's information will automatically appear on the second page once it is entered on the first page of the form.
- Go to Page 1 and double click on the Shipping Address Name field to open the Properties window.
- Click the Data tab and click the Change Data Element button located to the right of field.
The Properties window minimizes and changes into a Data Picker window.
Note: If you do not see the Data Element label and field, click box besideShow more properties.
- There are two ways to select items for mapping:
- Move the Data Picker window so the form items are visible. Click on the form item to select it and click OK.
- In the Data Picker window, expand page2 and select field1 and click OK.
This maps page1/field1 to page2/field1. Repeat this step to map all the fields on the first page to their corresponding fields on the second page.
Click the Viewer
tab to test the compute. Enter characters into the Name and Shipping Address fields and click Next
. The characters entered on the first page will appear in the corresponding fields on the second page.
Parent topic: XPath Editor