Solved

CFTREE selected value

Posted on 2010-08-18
6
855 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:kqureshi321
[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:kqureshi321
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
Schedule a Tour of the ATEN booth at InfoComm 2017

Tour the ATEN booth to see the the Latest Addition to the Modular Matrix Switch Series, New 4K HDMI Over IP Extender and more! Enter ATEN's Ultimate Giveaway Sweepstakes for a chance to win one of several great prizes, including an ATEN US7220 2-Port Thunderbolt 2 Sharing Switch!

 

Author Comment

by:kqureshi321
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 250 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:kqureshi321
ID: 33748044
May be we are not going to use cftree.
0

Featured Post

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

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

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

707 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