Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.