This works with a mySQL backend
In the form...
<cfselect name="to" size="1" bind="cfc:cfcs.messages.getOrganisations()" bindonload="yes" value="organisationID" display="organisationName" required="Yes">
</cfselect>
in the cfc
<cffunction access="remote" name="getOrganisations" output="false" returntype="query" displayname="Get organisations list" hint="This method returns a list of organisations as a query.">
<cfquery name="getOrganisations" datasource='myData'>
SELECT organisationID, organisationName, acceptsReferral, metadataTemplate
FROM organisations
WHERE acceptsReferral
ORDER BY organisationName ASC;
</cfquery>
<cfreturn getOrganisations>
</cffunction>
but if I try
<cffunction access="remote" name="getOrganisations" output="false" returntype="query" displayname="Get organisations list" hint="This method returns a list of organisations as a query.">
<cfquery name="getOrganisations" datasource='myData'>
SELECT '0' AS organisationID, 'Select' AS organisationName, false AS acceptsReferral, 0 AS metadataTemplate
FROM organisations
UNION
(SELECT organisationID, organisationName, acceptsReferral, metadataTemplate
FROM organisations
WHERE acceptsReferral
ORDER BY organisationName ASC)
</cfquery>
<cfreturn getOrganisations>
</cffunction>
to try and get a select leading row to the query, I get this AJAX error in firebug " JSON serialization failure: Unable to serialize binary data to JSON."
Henry's suggestion resolved the above, but I'm again slightly foxed by the next bit , trying to get two selects linked.
This works...
<cfselect name="attentionOf" size="1" bind="cfc:cfcs.messages.getOrganisationMembers({to})" bindonload="false" value="userID" display="name" required="No" queryPosition="below">
<option value="0">Select</option>
</cfselect>
...but if i try to pass in the DSN with the bound field I get "error parsing bind" from this
<cfselect name="attentionOf" size="1" bind="cfc:cfcs.messages.getOrganisationMembers({to}, 'mySqlData')" bindonload="false" value="userID" display="name" required="No" queryPosition="below">
<option value="0">Select</option>
</cfselect>