Solved

CFINPUT AutoSuggest not always working

Posted on 2011-03-25
5
746 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

707 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