?
Solved

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

Posted on 2008-10-15
2
Medium Priority
?
394 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 2000 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

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
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 reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

755 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