Skip to main content
August 5, 2010
Question

cfbind within a cfselect - How to have multiple values in display propery?

  • August 5, 2010
  • 1 reply
  • 1103 views

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?

This topic has been closed for replies.

1 reply

Inspiring
August 6, 2010

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.

August 6, 2010

Gotcha, thanks much.