The Cftree Form Variables; Input Validation - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

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="cd,folder">
The
cftreeitem
structure. If you leave out the
tree except the individual items, which have bullets.

The cftree form variables

The
tag lets you force a user to select an item from the tree control by setting the
cftree
attribute to Yes. With or without the
required
variables to the application page specified in the
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
the path value starts with the first node. If you specify a root name for a tree item using
, that value is returned as the root. If you do not specify a root name, ColdFusion
queryasroot
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 = Dept_ID\3\John Allen
Form.tree1.node = John Allen
You can specify the character used to delimit each element of the path form variable in the
cftree delimiter

Input validation

Although the
cftree
to force a user to select an item from the tree control. In addition, you can use the
attribute to specify your own JavaScript code to perform validation.
Description
Order the query results by department.
Populate the tree with the Department ID, and under each
department, the Full Name for each employee in the
department.
Label the root "Dept_ID".
Use the ColdFusion-supplied CD image for the root level and
Folder image for the department IDs. The names are
preceded by a bullet.
comma-separated
img
attribute, ColdFusion uses the folder image for all levels in the
img
attribute. The default is a backslash character.
does not include a
and the
attributes both correspond to the tree level
value
attribute, ColdFusion passes two form
required
cfform
action
attribute of
completepath
attribute, you can use the
validate
Building tree controls with cftree
attribute:
to Yes; otherwise,
cftree
required
onvalidate
attribute
589

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents