Ok James, I'm gettin close! I have it runnin the query when the page loads, 
which is of course not what I want. But this tells me things are workin. 

I've modified the example on your blog. Now, I'm REAL slow when it comes to JS, 
so bear with me here. 

Here's my JS call:

<script language="javascript">
        var url = "<cfoutput>#ajaxUrl#</cfoutput>";
        <cfoutput>
        function init() {
        new mxAjax.Data({
        executeOnLoad:true,
        paramArgs: new 
mxAjax.Param(url,{param:"eval=#FORM.eval#,T7=#FORM.Tier7#,T6=#FORM.Tier6#", 
cffunction:"getCourses"}),
       postFunction: handleData
       });
               
                function handleData(response) {
                    var myHTMLOutput = JSON.parse(response);
                    document.getElementById("myTargetSpan").innerHTML = 
myHTMLOutput;
                }
            }
           
            addOnLoadEvent(function() {init();});
                        </cfoutput>
        </script>

I left executeonload to true because This script is wrapped with a <cfif> 
anyway. It won't fire when the page loads, so I'm good to go there. 

Here's the function I stuck in example.cfc:

<cffunction name="getCourses" output="true">
  <cfargument name="eval">
  <cfargument name="T7">
  <cfargument name="T6">
  <cfset var courseArray = ArrayNew(1)>
  <cfset var getCourses = "">
  
  <cfquery datasource="#APPLICATION.dsn#" name="getCourses">
  SELECT 
  SectionID,
  Section, 
  evalid,
  Title,
  StudentID,
  Course
  FROM tblstudentcourses
  <!--- Get courses for the evaluation selected  --->
  WHERE evalid =
  <cfqueryparam cfsqltype="cf_sql_integer" value="#ARGUMENTS.eval#">
  <!--- Filter courses according to any organizational filters submitted --->
  <cfif Len(ARGUMENTS.T7) AND ARGUMENTS.T7 NEQ "All">
AND orgtier7code =
    <cfqueryparam value="#ARGUMENTS.T7#">
  </cfif>
  <cfif Len(ARGUMENTS.T6) AND ARGUMENTS.T6 NEQ "All">
AND orgtier6code =
    <cfqueryparam value="#ARGUMENTS.T6#">
  </cfif>
  </cfquery>
  
  <cfsavecontent variable="showCourseMenu">
  <select name="course">
                <option value="All">All</option>
          <cfoutput query="getCourses">
            <option value="#sectionid#">#section# - #title#</option>
          </cfoutput>
  </select>  
  </cfsavecontent>   
  <cfreturn showCourseMenu>
</cffunction>


Up to this point, things are workin nicely. That menu pops right up when an 
eval is chosen in the top dropdown - This is the coolest thing I've ever done!

Here's my trouble. How do I get it to fire off when any of those organization 
filters are changed? 

I already have an onChange in them for the qForms. Here's an example of Tier 7 
(stripping out the conditional stuff for easier reading:

 <select name="Tier7" 
onChange="objForm.Tier6.populate(stcTiers[objForm.Tier7.getValue()], null, 
null, stcBlank);">
   <option value="All">All</option>
     <cfoutput query="get7OrgTiers" group="orgtier7id">
     <cfoutput group="orgtier7id">
<option value="#orgtier7code#">#orgtier7title#</option>
</cfoutput> 
</select>

How do you fire this thing off? Can it be appended to the onChange?

Thanks a ton james!

Will

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280826
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to