This section provides an example of how to bind data to
a tree widget.
Before you begin
The procedure in this topic is an example of how to bind data
to a tree widget. To complete this example, you must first create
a sample
test.transaction file, and then create
a kColl as a root data container. Enter
testData as
the identifier for the kColl.
Note: Every .transaction file
must contain at least one kColl as a root data container.
For
information on how to create a
.transaction file,
refer to the
Creating a transaction file topic.
For information on how to create a kColl as a root data container
in the
.transaction file, refer to the
Defining data for a transaction flow topic.
Procedure
To bind data to a tree widget, do the following steps:
- In the test.transaction file, create
a new child field element for the root testData kColl.
- Open the test.transaction file
in the Transaction editor.
- In the Data panel, right-click kColl
[testData], and then click .
- In the Id field of the Detailed
Information panel, enter TreeName.
- Create a root kColl in the test.transaction file.
- Right-click in the Data panel,
and then click .
- In the Id field of the Detailed
Information panel, enter rootTree.
- Create a child refData element for the root testData kColl.
- In the Data panel, right-click kColl
[testData], and then click .
- In the RefId field of the Detailed
Information panel, click the Browse icon. The Select Data window is opened.
- In the Select Data window, expand Local,
and then click kColl [rootTree]. Click OK.
- Define a context for the test.transaction file.
- In Transaction editor, click the Context tab.
- Right-click in the Context panel,
and then click .
- In the Id field of the Detailed
Information panel, enter testContext.
- In the Context panel, right-click
the context that you are defining, and then click .
- In the RefId field of the Detailed
Information panel, click the Browse button. The Select KeyedCollection window
is opened.
- In the Select KeyedCollection window,
expand Local, and then click kColl
[testData]. Click OK.
- Save the test.transaction file.
- In the Enterprise Explorer pane, right-click the test.transaction file,
and then select .
- Open an XUI file, and bind the XUI file to the testContext
context of the test.transaction file.
- In the XUI editor, place a Tree widget into the XUI editor
area, and then bind the dataName property of the tree widget to treeName,
and bind the dataNameForTreeContent property of the tree widget to
rootTree.
Results
Data is bound to the Tree widget.