#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2007
    Posts
    114
    Rep Power
    0

    Triple related select


    I read Raymond Camden's blog post about triple related selects and I'm trying to implement a solution of my own. I can only get the first dropdown to populate and am getting three bind errors "Bind Failed, element not found: SelState ..." for the first two and then "Bind Failed, element not found: SelDestination ... " for the last.



    My code looks accurate (to me anyway) but clearly its not working.



    Can someone please help me debug this?


    Code:
    <cfform name="Localiza">
    <table>
    <tr>
    <td width="100">State:</td>
    <td width="150">
    <cfselect name="SelState" bind="cfc:_fc_cfc_triple.GetState()"
            display="misc_state" value="misc_state" BindOnLoad="true"/></td></tr>
    <tr>
    <td width="100">County:</td>
    <td width="150">
    <cfselect name="SelCounty" bind="cfc:_fc_cfc_triple.GetCounty({SelState})"
            display="destination_county" value="destination_county" BindOnLoad="false"/></td></tr>
    <tr>
    <td width="100">Destination:</td>
    <td width="150">
    <cfselect name="SelDestination" bind="cfc:_fc_cfc_triple.GetDestination({SelState},{SelDestination})"
            display="destination_name" value="destination_id" BindOnLoad="false"/></td></tr>
    </table>
    </cfform>

    The form is above, the cfc (_fc_cfc_triple.cfc) is below


    Code:
    <cfcomponent>
       
        <cffunction name="GetState" access="remote" returnType="query">
            <cfquery name="LstState" datasource="mydsn">
            SELECT misc_state
            FROM states_misc
            ORDER BY misc_state ASC
            </cfquery>
            <cfreturn LstState>
        </cffunction>
       
        <cffunction name="GetCounty" access="remote" returnType="query">
            <cfargument name="misc_state" type="any" required="true">
            <cfif #ARGUMENTS.misc_state# EQ "">
                <cfset LstCounty="">
            <cfelse>
                <cfquery name="LstCounty" datasource="mydsn">
                SELECT DISTINCT destination_county
                FROM destinations
                WHERE destination_state = #ARGUMENTS.misc_state#
                ORDER BY destination_county ASC
                </cfquery>
            </cfif>
            <cfreturn LstCounty>
        </cffunction>
       
        <cffunction name="GetDestination" access="remote" returnType="query">
            <cfargument name="misc_state" type="any" required="true">
            <cfargument name="destination_county" type="any" required="true">
            <cfif #ARGUMENTS.misc_state# EQ "" OR #ARGUMENTS.destination_county# EQ "">
                <cfset LstDestination="">
            <cfelse>
                <cfquery name="LstDestination" datasource="mydsn">
                SELECT destination_id,destination_name
                FROM destinations
                WHERE destination_state = #ARGUMENTS.misc_state#
                AND destination_county = #ARGUMENTS.destination_county#
                ORDER BY destination_name ASC
                </cfquery>
            </cfif>
            <cfreturn LstDestination>
        </cffunction>
    
    </cfcomponent>
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,263
    Rep Power
    968
    Have you enabled the AJAX debugging console, or used something like Firebug, to see if you're hitting any errors?

IMN logo majestic logo threadwatch logo seochat tools logo