Whatever message this page gives is out now! Go check it out!
name="name"
align="top|left|bottom|baseline|texttop|absbottom|
middle|absmiddle|right"
appendKey="yes|no"
bold="yes|no"
border="yes|no"
cache="yes|no"
completePath="yes|no"
delimiter="delimiter"
enabled="yes|no"
font="font"
fontSize="size"
format="applet|flash|html|object|xml"
height="integer"
highlightHref="yes|no"
hScroll="yes|no"
hSpace="integer"
italic="yes|no"
lookAndFeel="motif|windows|metal"
message="text"
notSupported="text">
onBlur="ActionScript to invoke"
onChange="ActionScript to invoke"
onError="text"
onFocus="Actionscript to invoke"
onValidate="script name"
required="yes|no"
style= "style specification"
tooltip="text"
visible="yes|no"
vScroll="yes|no"
vSpace="integer"
width="integer">
</cftree>Attribute | Req/OptFormat | Default | Description |
name | Required;All | Name for a tree control. | |
align | Optional;Applet, object |
| |
appendKey | Optional;All | yes |
|
bold | Optional;Applet, Flash, HTML | no |
|
border | Optional;Applet, object | yes |
|
cache | Optional;HTML | yes | Applies only if the tree's child treeitem tag uses a bind expression. A Boolean value that specifies whether to get new data each time the user expands tree nodes, as follows:
|
completePath | Optional;Applet, HTML, object | no |
|
delimiter | Optional;All | {{\\\\}} | Character to separate elements in the Forms.treename.path variable of the action page. |
enabled | Optional;Flash | yes | Flash format only: Boolean value that specifies whether the control is enabled. A disabled control appears in light gray. |
font | Optional;Applet, HTML | Font name for text in the tree control. | |
fontSize | Optional;Applet, Flash, HTML | Font size for text in the tree control, in pixels. | |
format | Optional;All | applet |
|
height | Optional;Applet, Flash | 320(applet only) | Tree control height, in pixels. If you omit this attribute in Flash format, Flash automatically sizes the tree. |
highlightHref | Optional;Applet, Object | yes |
|
hScroll | Optional;Applet, object | yes |
|
hSpace | Optional;Applet | Horizontal spacing to left and right of tree control, in pixels. | |
italic | Optional;Applet, Flash, HTML | no |
|
label | Optional;HTML, | ||
lookAndFeel | Optional;Applet, object | windows |
|
message | Optional;Applet, HTML | Message to display if validation fails. | |
notSupported | Optional;Applet | See Description | Text to display if a page that contains a Java applet-based cfform control is opened by a browser that does not support Java or has Java support disabled, for example;"<b> Browser must support Java to view ColdFusion Java Applets</b>"}}Default message:{{<b>Browser must support Java to <br>view ColdFusion Java Applets!</b> |
onBlur | Optional;Flash | ActionScript to run when the tree loses focus. | |
onChange | Optional;Flash | ActionScript to run when the control changes due to user action. If you specify an onChange event handler, the Form scope of the ColdFusion action page does not automatically get information about selected items. The ActionScript onChange event handler must handle all changes and selections. | |
onError | Optional;Applet, HTML | A JavaScript function to run if validation fails. | |
onFocus | Optional;Flash | ActionScript to run when the tree gets focus. The JavaScript DOM form object, value of the name attribute, value that failed validation, and any error text specified by the message attribute are passed to the method. | |
onValidate | Optional;Applet, HTML | JavaScript function to validate user input. The JavaScript DOM form object, input object, and input object value are passed to the specified routine, which must return true if validation succeeds; false, otherwise. | |
required | Optional;Applet, Flash, HTML | no |
|
style | Optional;Flash, HTML | Must be a style specification in CSS format. In HTML format, this attribute corresponds to the value of an HTML style attribute. In Flash format, use the same syntax and contents as used in Flex for the corresponding Flash element. | |
tooltip | Optional;Flash | Flash format only: Text to display when the mouse pointer hovers over the control. | |
value | Optional;HTML, | ||
visible | Optional;Flash | yes | Flash format only: Boolean value that specifies whether to show the control. Space that would be occupied by an invisible control is blank. |
vScroll | Optional;Applet, object | yes |
|
vSpace | Optional;Applet | Vertical margin above and below tree control, in pixels. | |
width | Optional;Applet, Flash | 200 (applet only) | Tree control width, in pixels. If you omit this attribute in Flash format, Flash automatically sizes 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. |
align | completePath | highlightHref | lookAndFeel |
appendKey | delimiter | hScroll | name |
bold | fontWeight | italic | vscroll |
border |
Field | Value |
children | This item's child items; an array of item structures. |
display | Tree item label, as determined by the cftreeitem display attribute. |
expand | Whether to expand the item to display any children; value of cftreeitem expand attribute. |
href | The URL to link to when the user selects the item; value of the cftreeitem href attribute. |
img | The tree image icon Image to display as an icon for the tree item; value of cftreeitem img attribute. You can use the img attribute to display custom icons only in the Applet version; not in the Flash version. |
imgOpen | Image to display when the tree item is open (expanded); value of cftreeitem imgopen attribute. |
parent | Value of this item's parent item in the tree. |
path | The node path from the tree root to the current element. |
queryAsRoot | Whether the query is the root of the item; value of cftreeitem queryAsRoot attribute. |
target | The link target, such as _blank; value of the item's cftreeitem target attribute. |
value | The item's value, as determined by the cftreeitem value attribute. |
SELECT d.dept_name, c.course_id, c.CorName, c.CorLevel, c.corName ||' ( ' ||c.corLevel ||' )' AS corLabel
FROM CourseList c, Departments d
WHERE d.Dept_ID = c.Dept_ID
ORDER BY d.dept_Name, c.corName, c.corLevel
</cfquery>
<cfform name="studentForm" format="flash" width="400" height="450">
<cftree name="courseTree" width="350" height="400">
<cftreeitem
query="getCourses"
value="dept_name,Course_id"
display="dept_name,CorLabel" queryasroot="NO" expand="yes,no">
</cftree>
</cfform><!--- Group the output by Department.
(All fields are required in Group By clause.) --->
<cfquery name = "GetEmployees" dataSource = "cfdocexamples">
SELECT Emp_ID, FirstName, LastName, EMail, Phone, Department
FROM Employees
GROUP BY Department, Emp_ID, FirstName, LastName, EMail, Phone
</cfquery>
<html>
<body>
<h3>cftree Example</h3>
<!--- The following runs if the user clicked on a link in the tree.
A complete application would use the ID for additional processing. --->
<cfif isdefined("Form.fieldnames")>
<b>Selected item information</b><br>
<cfoutput>
<b>Path: </b>#form.Employees.Path#<br>
<b>node: </b>#form.Employees.node#<br>
<br>
</cfoutput>
</cfif>
<!--- Display the tree. The cftree tag must be in a cfform. --->
<cfform action="#cgi.script_name#" preservedata="Yes" format="Flash">
<cftree name = "Employees" height = "400" width = "400"
font = "Arial Narrow" italic="yes" highlighthref="No" HScroll="no" VScroll="no"
completepath="no" lookandfeel="windows" border="No" required="yes">
<!--- cfoutput tag with a group attribute loops over the departments. --->
<cfoutput group="Department" query = "GetEmployees">
<cftreeitem value="#Department#" parent="Employees" expand="yes">
<!--- This cfoutput tag loops over the records for the department.
The cfoutput tag does not need any attributes. --->
<cfoutput>
<!--- Create an item for each employee in the department.
Do not expand children. Each employee name links to this page,
and sends the employee ID in the query string.--->
<cftreeitem value = "#LastName#, #FirstName#"
parent = "#Department#" expand="false" img="cd"
href="#cgi.script_name#?user_id=#emp_id#">
<!--- Each Employee entry has Id, and contact info children. --->
<cftreeitem value = "#Emp_ID#" display = "Employee ID: #Emp_ID#"
parent = "#LastName#, #FirstName#" img="remote">
<!--- Each node must be unique value, so use Emp_ID om value. --->
<cftreeitem value = "#Emp_ID#_ContactInfo" img="computer"
display = "Contact Information"
parent = "#LastName#, #FirstName#" expand = "false">
<!--- ContacInfo has two children --->
<cftreeitem value = "#Phone#" parent = "#Emp_ID#_ContactInfo">
<cftreeitem value = "#Email#" parent = "#Emp_ID#_ContactInfo">
</cfoutput>
</cfoutput>
</cftree>
<cfinput type="Submit" name="submitit" value="Submit" width="100">
</cfform>