User Guide

432 Chapter 2: ColdFusion Tags
Note: All attributes are passed to the XML generated in XML format, but no ColdFusion MX skin
interprets
cftree XML.
Usage
This tag must be in a cfform tag block.
The applet format tree requires the client to download a Java applet. Also, if the client does not
have an up-to-date Java plugin installed, the system might also have to download an updated Java
plugin to display an applet format tree. The Flash format tree uses a Flash control, and can be
embedded in an HTML format
cfform tag. For this tag to work properly in either Flash or applet
format, the browser must also be JavaScript-enabled.
Note: If you specify Flash format for this tag in an HTML format form, and you do not specify height
and
width attributes, Flash takes up more than the remaining visible area on the screen. If any other
output follows the tree, including any form controls, users must scroll to see it. Therefore, if you follow
a Flash tree in an HTML form with additional output, specify
height and width values.
If the following conditions are true, a user’s selection from query data that populates this tag’s
options continues to display after the user submits the form:
The cfform preserveData attribute is set to "Yes"
The cfform action attribute posts to the same page as the form itself (this is the default), or
the action page has a form that contains controls with the same names as corresponding
controls on the user entry form
For more information, see the
cfform tag entry.
Form variables
When you select a tree item and submit the form that contains the tree, ColdFusion creates a
structure with two variables in the action page Form scope. The structure name is the tree name.
The fields are as follows:
object format
If you specify object in the format attribute, ColdFusion returns the tree as a ColdFusion
structure, and does not send the tree to the browser. You can, for example, loop over the structure
to populate a menu, generate "breadcrumb" links for page navigation, or create a dhtml tree.
Note: If you specify an object format tree in an XML format form, ColdFusion does not generate the
tree.
Field Value
path The path through the tree to the selected node, in the form
[root\]node_1\node_2\.... In applet format, the path includes the root node
only if the
completePath attribute is True. In Flash format, the path always
includes the root node.
node The value of the selected tree node.