クエリに基づいて値を自動提案するテキスト フィールドがあります。クエリを保持する別のファイル (getdata.cfc) と共にメイン ファイルがあります。
メインファイルのテキストフィールド部分は次のとおりです。
<cfinput name="search_query" autosuggest="url:getdata.cfc?suggestvalue={cfautosuggestvalue}" maxResultsDisplay="10" showAutoSuggestLoadingIcon="true" size="10" />
getdata.cfc のコードは次のとおりです。
<cfcomponent>
<cffunction name="get_data" access="remote" output="false">
<cfargument name="suggestvalue" required="true">
<cfquery name="get_data" datasource="#application.DSN#">
SELECT DISTINCT myItem
FROM myTable
WHERE myItem LIKE <cfqueryparam value="#suggestvalue#%"
cfsqltype="cf_sql_varchar">
ORDER BY myItem
</cfquery>
<cfif get_data.recordCount eq 1>
<cfreturn ",#get_data.myItem#">
<cfelse>
<cfreturn ValueList(get_data.myItem)>
</cfif>
</cffunction>
</cfcomponent>
テキスト フィールドは正常に表示されますが、単語を入力しても自動提案値が表示されません。何も起こりません。入力したとおりにテキストが表示されます。
助言がありますか?ありがとうございました!