Solved

Question with CFTREE, or how to build a tree in Coldfusion

Posted on 2008-10-15
2
385 Views
Last Modified: 2013-12-16
I have a need to build a web site, and I think to make getting to various data easy, I wanted to build a tree in my web site, based on data from an Oracle database. Going through the Coldfusion books I have, I was looking to use CFTREE, and in theory, that works. It puts the data in the tree that I need. My problem is that I need to be able to click on the results of the tree and open a url. That works too, but not in the right place. For instance, in my tree, I have a main folder called Subtitles, then I have to folder under it, one called Family Life Center and another called Family Life Center 1 and this is retrieved from my database. If I click either one, I can open a url....but that's not where I want the url. Under each sub folder, is an entry from the database related to the Family Life Center or Family Life Center 1. In this case, called Review and Review1. I want the url on that, not on the folder, but I can't seem to get that to change. Is there a way to change the location of the url in CFTREE or is there a better way to get a database driven tree in my web site?? Thanks in advance for any help with this!! (My code is listed below

<cfquery datasource="MCA_Oracle" name="Subtitles">
SELECT CON_ACT.PROJECT_DESCRIPTION_2, CON_ACT.REVIEW_TYPE, CON_ACT.ID
FROM MCA.CON_ACT
WHERE CON_ACT.ID = '92408150812'
ORDER BY CON_ACT.REVIEW_TYPE, CON_ACT.PROJECT_DESCRIPTION_2
</cfquery>

<cfset id = '92408150812'>

<CFFORM FORMAT="flash">

<cftree name="treeReview"
      height="400"
      width="500" highlighthref="yes" appendkey="yes">
            
<cftreeitem query="Subtitles"
      value="PROJECT_DESCRIPTION_2,REVIEW_TYPE"
      display="PROJECT_DESCRIPTION_2,REVIEW_TYPE"
      expand="YES" parent="REVIEW_TYPE" href="dfgsdfsdf.cfm?id=#id#" >
                              
</cftree>

</CFFORM>
0
Comment
Question by:diecasthft
2 Comments
 
LVL 16

Accepted Solution

by:
duncancumming earned 500 total points
ID: 22970091
Instead of specifying the query attribute on cftreeitem, you probably want to roll your own use of cftreeitems, looping through your query.  e.g.:

<cftree name="treeReview"

	height="400"

	width="500" highlighthref="yes" appendkey="yes">
 

<cfoutput query="Subtitles">

	<cftreeitem

		value="#Subtitles.PROJECT_DESCRIPTION_2#"	    

		expand="YES">

	

	<cftreeitem

		value="#Subtitles.REVIEW_TYPE#"

		parent="#Subtitles.PROJECT_DESCRIPTION_2#"

		href="dfgsdfsdf.cfm?id=#Subtitles.id#">

</cfoutput>

                              

</cftree>

Open in new window

0
 

Author Closing Comment

by:diecasthft
ID: 31506263
Great!! Thanks Alot!!!
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
excpetion with multiple catch 11 113
Add server behaviors to Dreamweaver CC 2015 2 130
Problem to echo 6 81
Redirect HTTP to HTTPS in Azure 4 55
Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! https://www.google.com/about/careers/students/guide-to-technical-development.html How to Know You are Making a Difference at EE In August, 2013, one …
New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now