Solved

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

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
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 exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
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.

762 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

21 Experts available now in Live!

Get 1:1 Help Now