I'm new to the newer versions of ColdFusion and I'm having issues with a simple databind to a cfselect. I've done my best to thoroughly research it and I've even gone back to a textbook and essentially duplicated the code example in a test file and I still get the same error.
I'm trying to build the common situation where there are 2 cfselects and the second is dependent on the first, but at this point, I can't even get the first to work. The error returned is:
"Bind failed for select box Species_id, bind value is not a 2D array or valid serialized query"
Thanks in advance for any help. Here is the code:
<cfcomponent>
<cffunction name="getSpecies" access="remote" returnType="array">
<cfset var rsData = "">
<cfset var myReturn=ArrayNew(2)>
<cfset var i=0>
<cfstoredproc datasource="#application.dsn#" procedure="up_get_Species">
<cfprocresult name="DataResults">
</cfstoredproc>
<cfloop query="DataResults">
<cfset myReturn[rsData.currentRow][1]=rsData.Species_id>
<cfset myReturn[rsData.currentRow][2]=rsData.Species>
</cfloop>
<cfreturn myReturn>
</cffunction>
</cfcomponent>
<html>
<head>
<title>CFSelect Example</title>
</head>
<body>
<h1>Sandbox for getting cfselect bind working</h1>
<cfform name="form1">
Wood Type
<br>
<cfselect name="Species_id" bind="office.cfc:data.getspecies()"
bindOnLoad = "true" />
</cfform>
</body>
</html>