We help IT Professionals succeed at work.

CF8 Bind failed for autosuggest s

still have problems with trying to get a simple example of auto suggest with CF8 to work. i see NO reason why it should not work

the only error i get is

error:widget: Bind failed for autosuggest search, bind value is not a 1D array of strings
info:http: CFC invocation response:
error:widget: Bind failed for autosuggest search, bind value is not a 1D array of strings
info:http: CFC invocation response:
info:http: HTTP GET /components/utils.cfc?

what i have already tested

1) the path to the compontent is correct i have managed to pull from it using and returning the valueList (just not with autosuggest)
2) the database query is correct i.e i run the above and pulled from it
3) everything seems to mapped on my server correct i can access my cfide and script form the domain
4) i have tried a static autosuggest (no bind)  example and thats works i.e. autosuggest="apple,banana,lemon,lime,mango,orange,peach,pear"
my cfc
<!--- Lookup used for auto suggest --->
	<cffunction name="findPark" access="remote" returntype="string">
		<cfargument name="search" type="any" required="false" default="BEEF">	
		<!--- Define variables --->
		<cfset var local = {} />		
		<!--- Query Location Table --->
		<cfquery name="local.query" datasource="#application.dbSource#" username="#application.dbUsername#" password="#application.dbPassword#" >
            SELECT name
            FROM products
            WHERE name LIKE <cfqueryparam cfsqltype="cf_sql_varchar" value="%#ucase(arguments.search)#%" />
            ORDER BY name
		<!--- And return it as a List --->
		<cfreturn valueList(local.query.name)>
my bind....
<cfform action="test2.cfm" method="post">
	test:<br />
	<cfinput type="text" name="search" size="50" autosuggest="cfc:components.utils.findPark({cfautosuggestvalue})" autosuggestminlength="1" maxresultsdisplayed="10" /><br /><br />

Open in new window

Watch Question


Although the documentation says that you can return a list from the cfc, it only shows examples of returning an array.  Perhaps try converting the list to an array..

<cfreturn valueList(local.query.name)>


<cfreturn listToArray(valueList(local.query.name))>

It may be a long shot, but it does corresponds to the error message you're getting..


i get the same error message when returning an array

 <!--- Build result array --->
  <cfloop query="data">
    <cfset ArrayAppend(result, data.name)>
  <cfreturn result>

i also tried your convert code at the same error message again.

any other ideas?


still having problems with this, has anyone else got it running with a query of the same sort?
OK, problem resloved. incase anyone is having the same problem: my code is correct nothing wrong with what i was doing, my application OnRequest method screws up Ajax because if affects the http responses. You can not use OnRequest with AJAX in CF!!!

i don't necessarily know if it is a bug in CF8

Explore More ContentExplore courses, solutions, and other research materials related to this topic.