Quantcast
Channel: Adobe Community : Popular Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 14291

cfselect bind returns nothing

$
0
0

Hi,

I have a simple form with 2 selects. The 2nd is bound to the 1st. Issue seems to be that there is no response from the CFC call (I'm using the url parameter ?cfdebug to see this).

My co-worker & I have almost gone blind trying to see what's wrong with this code!

Any help is greatly appreciated!

 

Form code:

<cfajaximport tags="cfform">


<p>   
    <cfform action="rptLegend.cfm" name="legend" id="legend" method="post">
    <table align="center">
        <tr>
            <td>Choose a Building:</td> 
            <td><cfselect name="BuildingID"
                        size="1"
                        title="Choose the Building"
                        id="inputSelectMultiWide"
                        onfocus="this.style.background='##dddd66';"
                        onBlur="javascript: this.style.background='##ffffff';" 
                        onkeypress="javascript: if(event.keyCode==13) return false;"
                        query="Application.qBldgs"
                        queryposition="below"
                        value="BuildingID"
                        display="FullName">                       
                    <option value="">- Select -</option>
                </cfselect>
            </td>
        </tr>
        <tr>
            <td>Choose a Unit:</td> 
            <td><cfselect name="UnitNum"
                        size="1"
                        title="Choose the Unit"
                        id="inputSelect"
                        onfocus="this.style.background='##dddd66';"
                        onBlur="javascript: this.style.background='##ffffff';" 
                        onkeypress="javascript: if(event.keyCode==13) return false;"
                        bind="cfc:#Application.cfcPath#.Panels.GetBindUnit({BuildingID})"
                        display="UnitNum"
                        value="UnitNum">                       
                    <option value="">- Select -</option>                       
                </cfselect>
            </td>
        </tr>
    <tr>
        <td colspan="2" height="30">
            <p align="center">
            <button class="btnSubmit" type="button" value="Cancel" onclick="javascript: history.go(-1);"> Cancel </button> 
            <button class="btnSubmit" type="submit" value="d" name="submit" onclick="javascript: document.legend.submit;"> Get Square D Type Legend </button> 
            <button class="btnSubmit" type="submit" value="n" name="submit" onclick="javascript: document.legend.submit;"> Get Narrow Type Legend </button>
            </p>
        </td>
    </tr>
    </table>

</cfform>

 

 

cfc function:

<cfcomponent displayname="Panel functions" hint="Panel functions" output="false">

    <cffunction name="GetBindUnit" access="remote" output="true" returntype="query">
        <cfargument name="BuildingID" type="string" required="true">
       
        <!--- Define variables --->
        <cfset var result="">
        <cfset var temp="">
       
        <!--- get all units in Bldg to populate Unit select box --->
        <cfquery name="result" datasource="#Application.dSource#">
            SELECT UnitNum
            FROM Panels
            WHERE BuildingID LIKE <cfqueryparam value="#Arguments.BuildingID#" cfsqltype="cf_sql_varchar" maxlength="10">
        </cfquery>   
       
        <!--- make sure we return at least 1 row --->
        <cfif #result.recordcount# EQ 0>
            <cfset temp=QueryAddRow(result,1)>
            <cfset temp=Querysetcell(result,"UnitNum","NONE AVAILABLE")>
        </cfif>
       
        <cfreturn result />
    </cffunction>

</cfcomponent>

 

 

 

http://137.229.22.51/uaf/PanelMan/includes/inc_legend.cfm?cfdebug    -shows the empty response from the cfc call

 

Hope more eyes can help!

Thanks


Viewing all articles
Browse latest Browse all 14291

Trending Articles