Solved

Coldfusion 8 CFTREE Binding And Opening Documents....

Posted on 2009-05-19
4
502 Views
Last Modified: 2013-12-16
Hi,
Got a quick and hopefully easy to answer question. I've put together a very nice dynamic feature using the CFTREE in CF 8, which is bound to a cfc that takes a 3rd variable as the starting point or path. It works like a charm allowing the user to navigate various directories and sub-folders to view the files contained within each. The task I'm trying to solve now is how to allow the user to click on the document they find with this feaure and get it to open up. Since the CFTREE when used with binding only allows the attribute "bind" I can't see how to trigger an event to open the file up. I can place a test button within the CFFORM and view the path value using ColdFusion.getElementValue, but that is not very user friendly. Any direction or suggestions?

Cheers,
Ty
0
Comment
Question by:MedtronicVascSR
  • 2
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
stmatth earned 125 total points
Comment Utility
I'm not I completely understand what it is you're trying to do...but you can place <a href statements within the display parameter for each tree item.  If you can post some of your code, I might be able to get more specific.
0
 

Author Comment

by:MedtronicVascSR
Comment Utility
Actually, if you use the "bind" attribute in the CFTREEITEM then all other attributes, including HREF, are not allowed. "A tree is dynamic when the first cftreeitem tag of the tree has a bind attribute associated with it. The tag does not allow the attribute(s) VALUE,EXPAND,IMG,IMGOPEN,HREF,TARGET,QUERYASROOT,QUERY,DISPLAY,PARENT. The only required attribute is bind. "

I think the way this needs to be done is somehow passing back from the cfc file the HREF tag with info, but I'm not sure if this can be done or is the correct way. I haven't had any luck with it.

Cheers,
Ty
<cfform id="myForm_#MyFolderNumber#">

   <cftree name="dirtree_#MyFolderNumber#" height="400" width="200"  format="html">

	<cftreeitem bind="cfc:MyFolder_TAB.MyFolder.getDirEntries({cftreeitempath}, {cftreeitemvalue}, '#varDirPath1##Replace(Path, '+', ' ', 'All')#')">

    </cftree>

</cfform>

Open in new window

0
 

Author Closing Comment

by:MedtronicVascSR
Comment Utility
Thanks, I figured it out. I placed the HREF attribute in the CFC and passed it back to the tree item when it is a document. Thanks for the direction on this.

Cheers,
Ty
0
 
LVL 1

Expert Comment

by:stmatth
Comment Utility
No probs.  You can actually get quite creative with the display parameter of each tree item... essentially treat it like the row of a table.  If you enclose your display code with <td></td> it will behave as a table cell would.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
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 an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The viewer will learn how to dynamically set the form action using jQuery.

771 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

10 Experts available now in Live!

Get 1:1 Help Now