?
Solved

CFINPUT AutoSuggest not always working

Posted on 2011-03-25
5
Medium Priority
?
749 Views
Last Modified: 2013-12-24
I have implemented a CFINPUT AutoSuggest but it seems to work with some keywords but not others.

For example, when I put in "educ" I get the following and the box of suggested values come up fine.  The ajax call return value is below.

["Art, Design & Culture > Film > Educational","Causes > Education","Education > Continuing Education","Art, Design & Culture > Film > Educational","Education"]

When I put in "cont" no suggested values come up but the ajax call return values have results as shown below.

["Art, Design & Culture > Fine Arts > Contemporary","Art, Design & Culture > Museums > Contemporary Art","Education > Continuing Education","Art, Design & Culture > Parks & Gardens > Dance > Contra Dancing"]

Can somebody tell me what is causing this strange intermittent behavior?

Thanks in advance.


<cfinput type="text" name="Categories" autosuggest="cfc:cfc.Activities.SearchCategoryDefinitions({cfautosuggestvalue})" autosuggestminlength="3" size="80" maxlength="256">

Open in new window

0
Comment
Question by:SFTProd
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:srikanthmadishetti
ID: 35221947
paste ur SearchCategoryDefinitions function  code
0
 
LVL 13

Assisted Solution

by:srikanthmadishetti
srikanthmadishetti earned 2000 total points
ID: 35221963

try testing like below

write your query here and keep

autosuggest="#ValueList(ur queryname.colmunname)#"


if you are getting it correctly then there is some problem in the cfc function which u are using.




0
 

Author Comment

by:SFTProd
ID: 35223406
The function is below.  The strange part is that it works for some keywords and does not for others.
<cffunction name="SearchCategoryDefinitions" access="remote" returntype="Array">
    <cfargument name="suggestvalue" required="true">
     
    <cfquery name="FetchCategories" datasource="JR_Main">
      SELECT ActivityCategoryDefinitionID 
	  FROM ActivityCategoryDefinitions
	  WHERE Name LIKE <cfqueryparam value="%#suggestvalue#%">
	</cfquery>	
		
    <cfset results = ArrayNew(1)>
	<cfloop query="FetchCategories">
	  <cfquery name="FetchCategoriesTree" datasource="JR_Main">
        SP_CategoryTree #ActivityCategoryDefinitionID#
	  </cfquery>  

	  <cfset arrayAppend(results, FetchCategoriesTree.Tree)>
	</cfloop>
        
	<cfreturn results>	
  </cffunction>

Open in new window

0
 

Accepted Solution

by:
SFTProd earned 0 total points
ID: 35356275
It turns out that autosuugest property for CFINPUT only shows values that match the characters already typed into the form and does not show all values in the feed by query.
0
 

Author Closing Comment

by:SFTProd
ID: 35381943
I figured it out myself.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question