What will happen here is that your cfc function will return the
recordset as you expect. However, the javascript that processes this
resultset for the dropdown performs its own filter - stripping out
results that don't begin with what is in the input and so the results
never show.
The widget that CF uses for the autosuggest is from YUI
(http://developer.yahoo.com/yui/autocomplete/) and is configurable so
that it can match the string in various different ways - but CF gives
no interface to those options.
If you have the time and inclination, I would invest it in getting an
auto-suggest working without the cfinput tag (ie. pure js w/ ajax).
However, I did write a handy customtag wrapper to cfinput autosuggest
that allows you to set those options:
http://betterautosuggest.riaforge.org/
Your useage may look something like:
custom:betterautosuggest type=text name=lookup
autosuggest=cfc:cfcName.getEMPID({cfautosuggestvalue})
queryMatchContains=true /
HTH
Dominic
2009/4/16 Priya Koya priya23...@gmail.com:
Hi,
Sample code before I say anything about the issue..
cfform
Name:cfinput type=textname=lookup
autosuggest=cfc:cfcName.getEMPID({cfautosuggestvalue}) br /
Department:
cfselect name=userID id=userID bind=cfc:cfcName.getName({lookup})
display=userID
value=userID
bindOnLoad=false /
/cfform
cfc code..
cfcomponent
!---function to retun dept based on user name---
cffunction name=getName access=remote output=false
returntype=query
cfargument name=route_num
cfquery name=get_bnk_name datasource=cfdocexamples
SELECT emp_id as UserID
FROM Employees
where UCase(FirstName) =Ucase('#ARGUMENTS.route_num#')
/cfquery
cfreturn get_bnk_name
/cffunction
!---function to retun emp name based on entered letter---
cffunction name=getEMPID access=remote output=false
returntype=string
cfargument name=route_num
cfquery name=get_bnk_name datasource=cfdocexamples
SELECT FirstName,emp_id
FROM Employees
where UCase(FirstName) LIKE Ucase('%#ARGUMENTS.route_num#%')
/cfquery
cfreturn ValueList(getEMPID.FirstName)
/cffunction
I am using autosugest to display the data in the text field. as started
keying the id and once the id selected..I get name back in the select
statement sucessfully.
I am done with it But my concern is when I key in the id I should get the
dropdownlist in this format id-firstname.
ex: if id is 1
and the repective employer name is daniel then the autosugest dropdown
shoud show 1-Daniel.
I tried using something like this:
cffunction name=getEMPID access=remote output=false
returntype=string
cfargument name=route_num
cfquery name=get_bnk_name datasource=cfdocexamples
SELECT FirstName,emp_id
FROM Employees
where UCase(FirstName) LIKE Ucase('%#ARGUMENTS.route_num#%')
/cfquery
cfset arrayName = listtoarray(ValueList(getEMPID.FirstName))
cfset arrayemp_id = ListtoArray(ValueList(getEMPID.emp_id))
cfset bankname=arraynew(1)
cfset empName[i] = listtoarray(arrayName[i] '-' arrayemp_id[i])
cfreturn empName
/cffunction
I would really appreciate with any suggestion.
Thanks,
Priya
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321682
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4