Solved

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

Posted on 2008-10-15
2
386 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Customer support / help desk app 4 104
Video and audio capture on Windows 7 3 86
The Best Website Creation Tools 14 53
VBS to download an image from our website 4 15
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

806 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