• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 848
  • Last Modified:

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

0
pigmentarts
Asked:
pigmentarts
  • 3
1 Solution
 
gdemariaCommented:
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..

0
 
pigmentartsAuthor Commented:
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?
0
 
pigmentartsAuthor Commented:
still having problems with this, has anyone else got it running with a query of the same sort?
0
 
pigmentartsAuthor Commented:
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
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now