This content has been marked as final. Show 7 replies
thank you. I also has problems of passing list to cfcomponent. On the cfm page, i have a search and a couple checkbox to check where to search. So I need to pass it as a list over to the cfcomponent for sql. But it keeps on getting errors.
cfqueryparam's list attribute will solve your problem for you. However, since the list is coming from checkboxes, you'll have to contend with the possibility that none are selected.
thanks. but when i pass over the list to the cfc, it didn't work. Is there anyway to show what's been pass over to cfc? I am wondering what kind string is being passed over.
<cfdump var = "#arguments#">
you can't use a comma-delimited list in a BIND attribute of an
autosuggest element (and of most other new cf tags that support BIND
param) - you need to change the list delimiters to something else, like
| (pipe), using the listchangedelims() cf function.
then in your cfc function you will specify that new delimiter in any
tag/function you use to process the passed list, or you can change the
delimiter back to , (comma)...
if, say, your #filters# var value is "one, two, three", then the
autosuggest attribute in your <cfinput> tag should look like:
'#listchangedelims(filters, "|", ",")#')"
and your query in the cfc function will look like:
WHERE term LIKE <cfqueryparam cfsqltype="cf_sql_varchar"
AND distribution IN (<cfqueryparam list="yes" separator="|"
thank you, the list causes problem because of the comma...problem solved.