[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

CFTREE selected value

Posted on 2010-08-18
6
Medium Priority
?
860 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
Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

 

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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

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…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

656 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