Copy link to clipboard
Copied
I am binding a cfselect tag to a CFC, it's working as expected but I want to have more than one value populating the display="" part of the 2nd cfselect.The CFC returns a query of company information based off of the activty_id sent in.
This is what I currently have (roughly):
<cfajaxproxy cfc="mysite.templates.cfc.companies">
(this is working fine)
<cfselect name="activity_id" bind="cfc:mysite.templates.cfc.companies.fncActivity()" display="activity_name" value="activity_id" bindonload="yes" />
Here's where I want to display more than one value. This works as shown below but I want display="company_name company_city company_state" in the cfselect instead.
<cfselect name="company_id" bind="cfc:mysite.templates.cfc.companies.fncCompany({activity_id})" display="company_name" value="company_id" />
In debugging the CFC I am getting this returned:
Bind failed for select box company_id, columns matching the value or display attributes specified on the cfselect tag are not present in the query
Is this possible?
Copy link to clipboard
Copied
The display attribute can only reference a single column. Concatentate the values together under a single column in your query. Then use the new column name in your bind.
Copy link to clipboard
Copied
Gotcha, thanks much.