Link to home
Start Free TrialLog in
Avatar of mpsautomationteam
mpsautomationteam

asked on

CFSELECT bind to query with "selected" value

I am using bind to pull data into a select list, which then binds another select list to display drilled down results. I am unable to use the "selected" value in the cfselect. I want to be able to allow the user to return to the form and have the last selected results display. Here is my code:

<cfselect name="orgid" style="width:600px;" value="orgid" display="fullorg" selected="#form.orgid#" bind="cfc:lib.cfc.orgoffice.qryOrg()" bindonload="true" />

<cfselect name="officeid" size="5" style="width:600px;" multiple="yes" value="officeid" display="fulloffice" selected="#form.officeid#" bind="cfc:lib.cfc.orgoffice.qryOffice({orgid})" bindonload="true" />

The binding works fine, just the "selected" doesn't display the form.orgid value (same for the second one).
ASKER CERTIFIED SOLUTION
Avatar of digicidal
digicidal
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mpsautomationteam
mpsautomationteam

ASKER

Thank you, it works. It's ashame it's not an out of the box feature.
Yes, unfortunately that is almost always the 'growing pains' associated with developing 'bleeding-edge' solutions.  As I have found over the past 4 versions of CF (and application development in general) - it will take only about 4 weeks longer than you have in any given project for a new version or update to be released which will provide the features that you require.

I've done some more searching, and I can't find or come up with anything simpler - I'm glad, however, that at least this did work for you.

Good luck.
I would suggest another attribute for the cfselect tag like:
' bindSelected="#result.value# " to replace  ' selected="#result.value#" '
It would be a nice addition if it hasn't already been added in CF9.