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

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

LVL 2
CurtinPropAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

azadisaryevCommented:
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
0
azadisaryevCommented:
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
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CurtinPropAuthor 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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.