Hi everyone, I am trying to use a cfinput autosuggest from a database query via 
a CFC. The code example is given below. The CFC returns a list, but it doesn't 
get populated to a drop-down list (but it does if I hard-coded a list!). Any 
idea why? Kamru

--
index.cfm:
<cfform>
<cfINPUT TYPE="text" NAME="surname" SIZE="30" MAXLENGTH="40"
    autosuggest="cfc:staffData.getSurnames({cfautosuggestvalue})">
</cfform>
---

staffData.cfc:
<cfcomponent name="staffData" displayname="Staff Data CFC" output="false">
  
  <cffunction name="getSurnames" returnType="string" access="remote" 
output="no">
    <cfargument name="search" type="any" required="false" default="">

    <cfset var getSurnames = "">
    <cfquery name="getSurnames" datasource="#request.staffds#">
      SELECT
        DISTINCT surname
      FROM
        currentstaff 
      WHERE
        surname LIKE <cfqueryparam value="#arguments.search#%" 
cfsqltype="cf_sql_varchar">
    </cfquery>

    <cfreturn ValueList(getSurnames.surname)>
  </cffunction>
</cfcomponent> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:304321
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to