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
Solved

CFINPUT AutoSuggest not always working

Posted on 2011-03-25
5
744 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 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

860 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