Solved

Coldfusion 8 CFTREE Binding And Opening Documents....

Posted on 2009-05-19
4
507 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
[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
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
stmatth earned 125 total points
ID: 24430640
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
ID: 24433175
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
ID: 31583267
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
ID: 24433302
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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

717 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