macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

cfselect databindings..

Subject: cfselect databindings..
From: "rottmanja"
Date: Sat, 11 Aug 2007 22:06:18 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
I am playing around with my new coldfusion 8 install. I am trying to use Ben 
Forta's example to bind data from two of my cfc's But for some reason, my tests 
don't work at all. It does not populate any of the inputs and gives no errors


 Here is the code I am using


 test.cfm

 <cfform>
 <table>
 <tr>
 <td>Select Media Type:</td>
 <td><cfselect name="catUUID"
 bind="cfc:com.UtilityManager.List_Categories()"
 bindonload="true" /></td>
 </tr>
 <tr>
 <td>Select Art:</td>
 <td><cfselect name="secUUID"
 bind="cfc:com.UtilityManager.List_Sections({catUUID})" /></td>
 </tr>
 </table>
 </cfform>


 Function: List_Categories
    <cffunction name="List_Categories" access="remote" output="false" 
returntype="array">
       <cfquery name="GetCats" datasource="#this.DSN#">
          SELECT
             fld_category_UUID as catUUID,
             fld_category_Name as catName,
             fld_category_Alias
          FROM
             tbl_classAd_Categories
          ORDER BY
             fld_category_Order ASC
       </cfquery>
          <cfset catArr = arrayNew(1)>
          <cfset i = 1>
          <cfloop query="GetCats">
             <cfset catArr[i] = structNew()>
                <cfset catArr[i].catUUID = GetCats.fld_category_UUID>
                <cfset catArr[i].catName = GetCats.fld_category_Name>
                <cfset catArr[i].catAlias = GetCats.fld_category_Alias>
             <cfset i = i + 1>
          </cfloop>
       <cfreturn GetCats />
    </cffunction>

 Function: List_Sections

    <cffunction name="List_Sections" access="remote" output="false" 
returntype="array">
       <cfargument name="catUUID" required="yes" type="string" />         
          <cfquery name="GetSections" datasource="#this.DSN#">
             SELECT
                fld_section_UUID,
                fld_section_Name,
                fld_section_Alias,
                fld_category_UUID
             FROM
                tbl_classAd_Sections
             WHERE
                fld_category_UUID = <cfqueryparam cfsqltype="cf_sql_varchar" 
value="#arguments.catUUID#" />
          </cfquery>
          
          <cfset secArr = arrayNew(1)>
          <cfset i = 1>
          <cfloop query="GetSections">
             <cfset secArr[i] = structNew()>
                <cfset secArr[i].secUUID = GetSections.fld_section_UUID>
                <cfset secArr[i].secName = GetSections.fld_section_Name>
                <cfset secArr[i].secAlias = GetSections.fld_section_Alias>
                <cfset secArr[i].catUUID = GetSections.fld_category_UUID>
             <cfset i = i + 1>
          </cfloop>
       <cfreturn secArr />
    </cffunction>


<Prev in Thread] Current Thread [Next in Thread>
  • cfselect databindings.., rottmanja <=