Link to home
Create AccountLog in
Avatar of monosyth
monosythFlag for United States of America

asked on

Number of suggestions in an autosuggest list

I have used Ben Forta's example of creating an autosuggest list using a CFC. The default of returns seem to be 10 items. How do I change that to a different number?
<cfinput
      type="text"
      autosuggest="cfc:titles.getTitles({cfautosuggestvalue})"
      name="title"
      class="theInput"
      size="70"
      value=""
      maxlength="70"
      >

Open in new window

Avatar of erikTsomik
erikTsomik
Flag of United States of America image

check the query in the cfc itself
Avatar of monosyth

ASKER

Here is the CFC code...
<cfcomponent>
	
    <!--- FUNCTION get list of titles --->        
    <cffunction name="getTitles"
     			access="remote"
                returntype="array"
                output="false"
                hint="Get Prospective Titles for Ajax AutoSuggest">
        
        <cfargument name="search"
        type="any"
        required="false"
        default="">
        
        <!--- define variables --->        
        <cfset var data="">
        
        <cfset var result=ArrayNew(1)> 
 
        <!--- get data ---> 
               
        <cfquery name="data" datasource="#Application.dsn#">
        SELECT Title
        FROM AptTitles
        WHERE UCase(Title) LIKE UCase('#ARGUMENTS.search#%')
        ORDER BY Title
        </cfquery>
		
        <!--- and return it --->  
        
		 <cfloop query="data"> 
                 <cfset ArrayAppend(result, Title)> 
                </cfloop> 
        
        <cfreturn result>
	</cffunction>
</cfcomponent>

Open in new window

I think that 10 items returns because of the condition specified , you can test that by using query analyzer
ASKER CERTIFIED SOLUTION
Avatar of asiderop
asiderop
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Thank you, I knew it was something obvious like this...