MACROMEDIA COLFUSION MX 7-CFML Reference page 439

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

<html>
<body>
<h3>cftreeitem 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("URL.user_ID")>
<cfoutput>
<!--- URL.cftreeitemkey is the selected tree item's value attribute. --->
You Requested information on #URL.cftreeitemKey#; User ID #URL.user_ID#
</cfoutput>
<br><br>
</cfif>
<!--- Display the tree. The cftree tag must be in a cfform. --->
<cfform>
<cftree name = "Employees" height = "400" width = "200"
font = "Arial Narrow" highlighthref="No" hscroll="No">
<!--- 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#"
display = "#LastName#, #FirstName#"
parent = "#Department#" expand="no"
href="#cgi.script_name#?user_id=#emp_id#">
<!--- Each Employee entry has ID and ContactInfo children. --->
<cftreeitem value = "#Emp_ID#" display = "Employee ID: #Emp_ID#"
parent = "#LastName#, #FirstName#">
<!--- Each node must be unique value, so use Emp_ID om value. --->
<cftreeitem value = "#Emp_ID#_ContactInfo"
display = "Contact Information"
parent = "#LastName#, #FirstName#" expand = "No">
<!--- ContactInfo has two children. --->
<cftreeitem value = "#Phone#" parent = "#Emp_ID#_ContactInfo">
<cftreeitem value = "#Email#" parent = "#Emp_ID#_ContactInfo">
</cfoutput>
</cfoutput>
</cftree>
</cfform>
cftreeitem
439

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents