MACROMEDIA COLDFUSION MX 61-CFML Reference page 348

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

<!--- query the datasource to find the employee information--->
<cfquery name = "GetEmployees" dataSource = "cfsnippets">
SELECT Emp_ID, FirstName, LastName, EMail, Phone, Department
FROM
Employees where lastname
<cfif #employeeNames# is not ""> = '#employeeNames#'</cfif>
</cfquery>
<html>
<body>
<h3>cftree Example</h3>
<!--- Use cfform when using other cfinput tools --->
<cfform action = "cftree.cfm">
<!--- Use cfselect to present the contents of the query by column --->
<h3>cfselect Presentation of Data</h3>
<h4>Click an employee's last name and "see information for this employee",
to see expanded information.</h4>
<cfselect name = "EmployeeNames" message = "Select an Employee Name"
size = "#getEmployees.recordcount#" query = "GetEmployees"
value = "LastName" required = "No">
<option value = "">Select All
</cfselect>
<input type = "Submit" name = ""
value = "see information for this employee">
<!--- showing the use of cftree --->
<!--- Use cftree for an expanded presentation of the data --->
<!--- Loop through the query to create each branch of the cftree --->
<h3>cftree Presentation of Data</h3>
<h4>Click on the folders to "drill down" and reveal information.</h4>
<p>cftreeitem is used to create the "branches" of the tree.
<p>
<cftree name = "SeeEmployees" height = "150" width = "240"
font = "Arial Narrow" bold = "No"
italic = "No" border = "Yes"
hScroll = "Yes" vScroll = "Yes"
required = "No" completePath = "No"
appendKey = "Yes" highlightHref = "Yes">
<cfloop query = "GetEmployees">
<cftreeitem value = "#Emp_ID#" parent = "SeeEmployees" expand = "No">
<cftreeitem value = "#LastName#" display = "Name"
parent = "#Emp_ID#" queryAsRoot = "No"
expand = "No">
<cftreeitem value = "#LastName#, #FirstName#"
parent = "#LastName#" expand = "No"
queryAsRoot = "No">
<cftreeitem value = "#Department#" display = "Department"
parent = "#Emp_ID#" queryAsRoot = "No"
expand = "No">
<cftreeitem value = "#Department#" parent = "#Department#"
expand = "No" queryAsRoot = "No">
<cftreeitem value = "#Phone#" display = "Phone"
parent = "#Emp_ID#" queryAsRoot = "No"
expand = "No">
<cftreeitem value = "#Phone#" parent = "#Phone#"
expand = "No" queryAsRoot = "No">
<cftreeitem value = "#Email#" display = "Email" parent = "#Emp_ID#"
queryAsRoot = "No" expand = "No">
<cftreeitem value = "#Email#" parent = "#Email#" expand = "No"
queryAsRoot = "No">
</cfloop>
</cftree>
...
348
Chapter 2: ColdFusion Tags

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents