Solved

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

Posted on 2008-10-15
2
390 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
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…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

707 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