Link to home
Start Free TrialLog in
Avatar of pigmentarts
pigmentartsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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
		</cfquery>
		<!--- And return it as a List --->
		<cfreturn valueList(local.query.name)>
	</cffunction>
    
 
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 />
</cfform>

Open in new window

Avatar of gdemaria
gdemaria
Flag of United States of America image

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)>

to

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


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

Avatar of pigmentarts

ASKER

i get the same error message when returning an array

 <!--- Build result array --->
  <cfloop query="data">
    <cfset ArrayAppend(result, data.name)>
  </cfloop>
  <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?
ASKER CERTIFIED SOLUTION
Avatar of pigmentarts
pigmentarts
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial