Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Passing the value of a select field from one cfwindow to another.

Posted on 2010-09-08
1
Medium Priority
?
473 Views
Last Modified: 2012-05-10
I can't figure out how to pass the value of the selectedUserID into the cfwindow 'w2'
<cfparam name="selectedUserID" default="">

<html>
<head>

<script language="javascript">
    var mycallBack = function(){
        document.getElementById("callback").innerHTML = "<br><br><b>This is printed by the callback handler.</b>";
    } 

<!--- The error handler pops an alert with the error code and message. --->
    var myerrorhandler = function(errorCode,errorMessage){
        alert("[In Error Handler]" + "\n\n" + "Error Code: " + errorCode + "\n\n" + "Error Message: " + errorMessage);
    } 
</script>


</head>
<cfoutput>
<body>
<cfwindow name="w1" title="CF Window 1" initShow=true 
    x=10 y=10 width="400" height="200">
    User Administration.<br><br>
    <cfform name="myForm">
    <select name="SelectedUserID" 
    onChange="ColdFusion.navigate('test2.cfm?selectedUserID=(this.options[this.selectedIndex].value)','w2',
        mycallBack,myerrorhandler);">
    		<option value="">Please Select</option>
            <cfloop query="session.qry_getUsers">
    		<option value="#id#" <cfif selectedUserID eq id>selected</cfif>>#displayName#</option>
  			</cfloop>
	</select>
    </cfform>
   
</cfwindow>

<cfwindow name="w2" title="CF Window 2" initShow=true 
    x=450 y=10 width="600" height="600">
    This is a second cfwindow control. This is where I try and dump the variables and I'm not getting selectedUserID
</cfwindow>
</body>
</cfoutput>
</html>

Open in new window

0
Comment
Question by:traport
[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
1 Comment
 

Accepted Solution

by:
traport earned 0 total points
ID: 33629738
Disregard I figured it out

<html>
<head>
<!--- The Callback handler puts text in the window.cfm callback div. --->
<script language="javascript">
    var mycallBack = function(){
        document.getElementById("callback").innerHTML = "<br><br><b>This is printed by the callback handler.</b>";
    }

<!--- The error handler pops an alert with the error code and message. --->
    var myerrorhandler = function(errorCode,errorMessage){
        alert("[In Error Handler]" + "\n\n" + "Error Code: " + errorCode + "\n\n" + "Error Message: " + errorMessage);
    }
</script>


</head>
<cfoutput>
<body>
<cfwindow name="w1" title="CF Window 1" initShow=true
    x=10 y=10 width="400" height="200">
    User Administration.<br><br>
    <cfform name="myForm">
    <select name="SelectedUserID" onChange="ColdFusion.navigate('test2.cfm','w2',
        'mycallBack', 'myerrorhandler', 'post', 'myForm');">
                <option value="">Please Select</option>
            <cfloop query="session.qry_getUsers">
                <option value="#id#" <cfif selectedUserID eq id>selected</cfif>>#displayName#</option>
                    </cfloop>
      </select>
    </cfform>
   
</cfwindow>

<cfwindow name="w2" title="CF Window 2" initShow=true
    x=450 y=10 width="600" height="600">
    This is a second cfwindow control.
</cfwindow>
</body>
</cfoutput>
</html>
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
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 Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

660 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