?
Solved

CFTREE selected value

Posted on 2010-08-18
6
Medium Priority
?
857 Views
Last Modified: 2013-12-24
Hello,
I need to pass value of the selected item of the tree on popup window to the textbox on the parent page. I tried to use spec.selectedNode.getProperty('data').value and nothing happens. Is there any other way i can get the value of the selected node?  Any help is appreciated.

1)   PARENT WINDOW PARENT.CFM
<SCRIPT LANGUAGE="Javascript">
function OpenTree(href)
{
      remote = window.open(href,'popUp','width=400,height=480,resizable=1,scrollbars=1');
}
</script>
 <cfinput name="spec1" type="text" value="" size="31" id="spec1">
 <a href="tree.cfm  onClick="OpenTree(this.href);return false"> <img src="../images/info.gif" width="20" height="20" border="0" ></a>
                 
2)   THIS IS POPUP WINDOW TREE.CFM
<cfquery name="selspec" datasource="#request.datasource#">
SELECT   specid,SPEC_ID,SPEC_DESC,parent_spec_id, me
from spec where spec_id IS NOT NULL

</cfquery>

<cfform name="specsel">
<cftree  format="html" name="spec">
    <cfoutput query="selspec">
      
      <cfif #spec_id# eq #parent_spec_id#>
      <cfset specparent="#me#">
       <cftreeitem  display="#specparent#" value="#specparent#"  img="FOLDER01.gif"  imgopen="FOLDER02.gif" expand="false">
       <cfelse>
              <cfset specchild=#SPEC_ID# & ' - ' & "#SPEC_DESC#">
              <cftreeitem display="#specchild#" value="#specchild#"  parent="#specparent#">
       </cfif>            
       </cfoutput>            
</cftree>
</cfform>
0
Comment
Question by:Galina Besselyanova
[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
  • 3
  • 3
6 Comments
 
LVL 29

Expert Comment

by:Pravin Asar
ID: 33475326
You can do href

    <cftreeitem value="#specparent#"   href="javascript:OpenTree( 'http://yourlinke.cfm?value=' + #specparent#" #); "  ...

0
 

Author Comment

by:Galina Besselyanova
ID: 33505411
thanks.
What if specchild is selected?
0
 
LVL 29

Expert Comment

by:Pravin Asar
ID: 33510178
When an item is selected (Clicked), you can bind with click event

See the code example


<cfform name="f1" format="html">
	<cftree  name="tree1" format="html" >
		<cftreeitem value="1" parent="0" display="Root Node"/>
		<cftreeitem value="2" parent="1" display="Branch 1"/>
		<cftreeitem value="3" parent="1" display="Branch 2"/>
		<cftreeitem value="21" parent="2" display="Branch 1.1"/>
		<cftreeitem value="22" parent="2" display="Branch 1.2"/>
		<cftreeitem value="31" parent="3" display="Branch 2.1"/>
		<cftreeitem value="32" parent="3" display="Branch 2.2"/>
		<cftreeitem value="33" parent="3" display="Branch 2.3"/>
	</cftree>
	<cfinput type="text" name="dbgText" bind="{tree1.node@click}"/>
</cfform>

Open in new window

0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:Galina Besselyanova
ID: 33515337
That i understand, but in my case i need to pass selected value to the parent page and i don't want to use url.

0
 
LVL 29

Accepted Solution

by:
Pravin Asar earned 1000 total points
ID: 33523544
If you want to pass selected value to the parent page, then I think you have to use some javascript.

Look at

http://www.rgagnon.com/jsdetails/js-0066.html
0
 

Author Closing Comment

by:Galina Besselyanova
ID: 33748044
May be we are not going to use cftree.
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
What You Need to Know when Searching for a Webhost Provider
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month10 days, 5 hours left to enroll

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