Solved

CFINPUT AutoSuggest not always working

Posted on 2011-03-25
5
736 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
Comment Utility
paste ur SearchCategoryDefinitions function  code
0
 
LVL 13

Assisted Solution

by:srikanthmadishetti
srikanthmadishetti earned 500 total points
Comment Utility

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
Comment Utility
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
Comment Utility
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
Comment Utility
I figured it out myself.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now