Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Coldfusion 8 CFTREE Binding And Opening Documents....

Posted on 2009-05-19
4
Medium Priority
?
510 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 375 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
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…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Suggested Courses

810 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