Question
cfinput autosuggest
I'm a little frustrated with CF8 and the new Spry functions.
I'm trying to convert my old autosuggests to the cfinput and
binding with a function in a cfc. I'm trying to follow the examples
but getting the following error;
Error invoking CFC /components/tsijobads cfc. Internal server error (enable debugging .......)
The code is;
<cffunction name="getCompanies" access="remote" returntype="array" output="false" description="Returns submission titles">
<cfargument name="term" type="string" required="true">
<cfset var CnameQry = "">
<cfquery name="CnameQry" datasource="AS400" dbtype="ODBC" maxrows="50">
SELECT rtrim(ltrim(csnam1)) as cname, rtrim(ltrim(csstat)) as state, rtrim(ltrim(cscity)) as city, csrec## as companyid
FROM cstatic
WHERE UPPER(csnam1) LIKE <cfqueryparam cfsqltype="cf_sql_varchar" value="#ucase(left(arguments.term,255))#%">
order by csnam1,cscity
</cfquery>
<!--- Build result array --->
<cfset Carray = listotarray(CnameAry.csnam1)>
<cfreturn Carray>
</cffunction>
<cfinput name="sfCname#counter#" id="sfCname#counter#" autosuggest="cfc:400comps.tsijobads.getCompanies({cfautosuggestvalue})" maxResultsDisplay="50">
Error invoking CFC /components/tsijobads cfc. Internal server error (enable debugging .......)
The code is;
<cffunction name="getCompanies" access="remote" returntype="array" output="false" description="Returns submission titles">
<cfargument name="term" type="string" required="true">
<cfset var CnameQry = "">
<cfquery name="CnameQry" datasource="AS400" dbtype="ODBC" maxrows="50">
SELECT rtrim(ltrim(csnam1)) as cname, rtrim(ltrim(csstat)) as state, rtrim(ltrim(cscity)) as city, csrec## as companyid
FROM cstatic
WHERE UPPER(csnam1) LIKE <cfqueryparam cfsqltype="cf_sql_varchar" value="#ucase(left(arguments.term,255))#%">
order by csnam1,cscity
</cfquery>
<!--- Build result array --->
<cfset Carray = listotarray(CnameAry.csnam1)>
<cfreturn Carray>
</cffunction>
<cfinput name="sfCname#counter#" id="sfCname#counter#" autosuggest="cfc:400comps.tsijobads.getCompanies({cfautosuggestvalue})" maxResultsDisplay="50">