cfselect bind error "is not valid 2D array or serialized query"

CurtinProp
CurtinProp used Ask the Experts™
on
Hi guys,

This is a continuation of the following thread:

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/Cold_Fusion_Markup_Language/Q_26199844.html

The question was answered fine and I really cant see any problems with the source (see below)..

However I'm getting the following error:

"Bind failed for select box [levels], bind value is not a 2D array or valid serialized query"

Any thoughts?

cheers
-- page1.cfm --


<cfquery name="qbuildings" datasource="...">
	select bl_id from BL
	where site_id = '1'
</cfquery>



<cfform name="muform" preservedata="yes">
<cfselect name="buildings" id="buildings" query="qbuildings" display="bl_id" value="bl_id" />

<br>
<cfselect name="levels" id="levels" bind="application.buildings.getBuildingLevels({buildings})" display="fl_id" value="fl_id" />
</cfform>


-- buildings.cfc --

<cfcomponent displayname="buildings" output="no">

  <cffunction name="getBuildingLevels" access="public" returntype="query" output="false">
    
    <cfargument name="buildingid" required="true" type="any">
    <cfset var qLevels = "">
    
        <cfquery name="qLevels" datasource="afm_fire">
       		select fl_id
            from afm.fl
			where bl_id = <cfqueryparam  value="#arguments.buildingid#" cfsqltype="cf_sql_varchar">
        </cfquery>
    
    <cfreturn qLevels>
  </cffunction>
</cfcomponent>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
unfortunately, you can't bind to a cfc stored in application scope. BIND attribute needs a dot-delimited physical path to the cfc on the server.

Azadi
hmm... or is your cfc actually in a folder named 'application'? that may cause some problems, too, i think...
but try adding cfc: qualifier to the bind attribute:

bind="cfc:application.buildings.getBuildingLevels({buildings})"

assumes your buildings.cfc is in /applications subfolder of current page's folder.

Azadi

Author

Commented:
Legend!

your spot on mate.... I had originally defined the cfc in my application scope...

For anyone reading this thread I added the "cfc:" and gave the bind a relative path..... You also have to make sure the access param is set to "remote".

thanks man.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial