Skip to main content
WebolutionDesigns
Known Participant
August 24, 2011
Question

Multiple CFC binding on CFSELECT

  • August 24, 2011
  • 1 reply
  • 604 views

Does anyone out there know how to have multiple cfc bindings on a cfselect and have it affect the selected attribute? I have a straight forward cfselect that is binding to another cfselect...

<cfselect name="make"  display="DESCRIPTION" value="MAKE" multiple="no" queryPosition="below" bind="cfc:cfc.partsrequest.getMakes()" />

This works great, but what I would like to do is to have one of the items returned be selected (via the selected attribute) by a different cfc. Has anyone ever done something like this?

~Clay

This topic has been closed for replies.

1 reply

Participant
September 14, 2011

Why not just set a variable that contains the value you want to select.

<!--- make your CFC return the value that you want to show as selected --->

<cfset theValueToBeSelected  = cfc.partsrequest.YourOtherCFCThatDeterminesWhichOneYouWantToSelect()>

<cfselect name="make"  display="DESCRIPTION" value="MAKE"  multiple="no" queryPosition="below"  bind="cfc:cfc.partsrequest.getMakes()"  selected="#theValueToBeSelected#" />

That should take care of it.