Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 732

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
2
Save the page and view it in your browser.
Reviewing the code
The following table describes the highlighted code and its function
Code
ORDER BY Dept_ID
<cftreeitem value="Dept_ID,FullName"
queryasroot="Dept_ID"
img="computer,folder,document"
imgopen="computer,folder"
The
comma-separated
cftreeitem
applet format, if you omit the
attribute, ColdFusion uses the folder image for all expanded levels in the tree. Flash format ignores the
imgopen
and
attributes and always uses folders for levels with children and documents for nodes without children.
imgopen
The cftree form variables
The
tag lets you force a user to select an item from the tree control by setting the
cftree
With or without the
required
attribute:
cfformaction
• Form.treename.path Returns the complete path of the user selection, in the form:
[root]\node1\node2\node_n\value
• Form.treename.node Returns the node of the user selection.
To return the root part of the path, set the
starts with the first node. If you specify a root name for a tree item using the
as the root. If you do not specify a root name, ColdFusion returns the query name as the root. If there is no query name,
ColdFusion returns the tree name as the root.
In the previous example, if the user selects the name "John Allen" in the tree, ColdFusion returns the following form
variables:
Form.tree1.path = 3\John Allen
Form.tree1.node = John Allen
The deptquery root does not appear in the path, because the
can specify the character used to delimit each element of the path form variable in the
The default is a backslash character (\).
Input validation
Although the
tag does not include a
cftree
select an item from the tree control. In addition, you can use the
code to perform validation.
Description
Orders the query results by department.
Populates the tree with the department ID, and under each department, the full
name for each employee in the department.
Labels the root "Dept_ID".
Uses the ColdFusion supplied computer image for the root level, folder image for the
department IDs, and document for the names, independent of whether any level is
expanded (open) or collapsed. The
the employee names can never be open.
,
, and
value
img
imgopen
attribute, ColdFusion uses the folder image for all levels in the tree; if you omit the
img
attribute, ColdFusion passes two form variables to the application page specified in the
attribute of the
completepath
attribute, you can use the
validate
Last updated 1/20/2012
imgopen
attribute has only two items, because
attributes correspond to the tree level structure. In
tag to Yes; otherwise, the path value
cftree
queryasroot
tag does not specify
cftree
cftreedelimiter
required
attribute to specify your own JavaScript
onValidate
img
attribute to Yes.
required
tag, that value is returned
"
". You
completePath=
Yes
attribute.
attribute to force a user to
727

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents