Chapter 10: Building Dynamic Forms
133
Example: Multi-level tree control
When populating a CFTREE, you manipulate the structure of the tree by specifying a
TREEITEM parent. In this example, every TREEITEM, except the top level, specifies a
parent. The PARENT attribute allows your CFTREE to show the relationships between
elements in the tree control.
<CFFORM NAME="form1" ACTION="cfform_submit.cfm"
METHOD="Post">
<CFTREE NAME="tree1" HSCROLL="no" VSCROLL="no"
BORDER="no">
<CFTREEITEM VALUE="Divisions">
<CFTREEITEM VALUE="Development"
PARENT="Divisions" IMG="folder">
<CFTREEITEM VALUE="Product One"
PARENT="Development">
<CFTREEITEM VALUE="Product Two"
PARENT="Development">
<CFTREEITEM VALUE="GUI"
PARENT="Product Two" IMG="document">
<CFTREEITEM VALUE="Kernel"
PARENT="Product Two" IMG="document">
<CFTREEITEM VALUE="Product Three"
PARENT="Development">
<CFTREEITEM VALUE="QA"
PARENT="Divisions" IMG="folder">
<CFTREEITEM VALUE="Product One"
PARENT="QA">
<CFTREEITEM VALUE="Product Two" PARENT="QA">
<CFTREEITEM VALUE="Product Three"
PARENT="QA">
<CFTREEITEM VALUE="Support"
PARENT="Divisions" IMG="fixed">
<CFTREEITEM VALUE="Product Two"
PARENT="Support">
<CFTREEITEM VALUE="Sales"
PARENT="Divisions" IMG="cd">
<CFTREEITEM VALUE="Marketing"
PARENT="Divisions" IMG="document">
<CFTREEITEM VALUE="Finance"
PARENT="Divisions" IMG="element">
</CFTREE>
</CFFORM>
Image names in a CFTREE
When you use the TYPE="Image" attribute, ColdFusion attempts to display an image
corresponding to the value in the column, which can be a built-in ColdFusion image
name, or an image of your choice in the
cfide\classes
directory or subdirectory,
referenced with a relative URL.
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...