The +?+?++Tree+?+?+? control is listed under the +?+?++Composite Rich Controls+?+?+? section of the palette on the Page Structure tab within FormMaker.
This control provides a tree representation of some XML data. The user can expand and collapse sections of the tree, and then select the required value.
To add the control to the page, simply drag it from the palette onto your page in the same way as you would for any other control.
This will add a number of components onto your page, including a +?+?++tree_data_context+?+?+? repeat, and a +?+?++selected_tree_item+?+?+? hidden field.
The selected_tree_item field will contain the value of the tree item selected by the user. If you would like to perform some kind of action when the user selects a value, then you should add an +?+?++onchange+?+?+? event to this field.
The tree_data_context repeat is used to set the data that should be displayed in the tree.
On the +?+?++Data Bindings+?+?+? tab, the +?+?++Repeating Data Location+?+?+? setting for this repeat should be set to point to the element that is the root of the data to display in the tree.
By default, the value used for the leaf nodes in the tree will be the text content of the relevant XML element, and branch nodes will use the name of the XML element they represent. It is possible to override the displayed names however by adding a +?+?++name+?+?+? attribute to the appropriate XML element.
For example, the following XML fragment will produce a tree like that shown in the image below.
Please note, that using the name attribute to change the displayed text for a leaf node will not affect the value placed into the selected_tree_item hidden field. This will still be the text content of the XML element.
The tree will only support a depth of up to 5 levels by default, but this can be extended by adjusting the content of the +?+?++tree+?+?+? custom field on the +?+?++Field Details+?+?+? tab. Please look at the contents of this custom field for more details.
This control provides a tree representation of some XML data. The user can expand and collapse sections of the tree, and then select the required value.
To add the control to the page, simply drag it from the palette onto your page in the same way as you would for any other control.
This will add a number of components onto your page, including a +?+?++tree_data_context+?+?+? repeat, and a +?+?++selected_tree_item+?+?+? hidden field.
The selected_tree_item field will contain the value of the tree item selected by the user. If you would like to perform some kind of action when the user selects a value, then you should add an +?+?++onchange+?+?+? event to this field.
The tree_data_context repeat is used to set the data that should be displayed in the tree.
On the +?+?++Data Bindings+?+?+? tab, the +?+?++Repeating Data Location+?+?+? setting for this repeat should be set to point to the element that is the root of the data to display in the tree.
By default, the value used for the leaf nodes in the tree will be the text content of the relevant XML element, and branch nodes will use the name of the XML element they represent. It is possible to override the displayed names however by adding a +?+?++name+?+?+? attribute to the appropriate XML element.
For example, the following XML fragment will produce a tree like that shown in the image below.
<food>
<fruit>
<item name="Apples are great">Apple</item>
<item>Pear</item>
<item>Banana</item>
</fruit>
<veg name="Vegetables">
<item>Carrot</item>
<item>Cabbage</item>
</veg>
</food>
Please note, that using the name attribute to change the displayed text for a leaf node will not affect the value placed into the selected_tree_item hidden field. This will still be the text content of the XML element.
The tree will only support a depth of up to 5 levels by default, but this can be extended by adjusting the content of the +?+?++tree+?+?+? custom field on the +?+?++Field Details+?+?+? tab. Please look at the contents of this custom field for more details.
Attachment