In my example, I have a set of drop downs that are tiered dependent (Coldbox 3.5+, CF9)
Using bindCFC and cfajax , here is an example of the first two drop downs the second being dependent
My view snippet
<cfform>
<cfselect name="groups" id="groups" bind="cfc:#getSetting('AppMapping')#.model.dynform.getGroups()"
bindOnLoad="Yes"
display="group_name"
value="group_id" />
<cfselect name="events" id="events" selected="#form.event_id#"
bind="cfc:#getSetting('AppMapping')#.model.dynform.getEventsByGroup({groups})"
display="event_name"
value="event_id"
queryPosition="below">
</cfform>
My model (dynform) snippet
<cffunction name="getGroups" access="remote" output="false" returntype="query">
<cfset var qGroups = "">
<cfquery datasource="#application.DSN#" name="qGroups">
SELECT
egc.nd_event_group_id group_id,
egc.short_desc group_name
FROM event_group_code egc
WHERE egc.status_code = 'A'
ORDER BY egc.sort_order
</cfquery>
<cfreturn qGroups>
</cffunction>
<cffunction name="getEventsByGroup" access="remote" output="false" returntype="query">
<cfargument name="event_group_id" type="string" required="true">
<cfset var qEventsByGroup = "">
<cfquery datasource="#application.DSN#" name="qEventsByGroup">
SELECT ec.event_id,
ec.FULL_DESC as event_name
FROM events ec
WHERE ec.event_group_id = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.event_group_id#">
</cfquery>
<cfreturn qEventsByGroup>
</cffunction>
Though the above will work, I ended up ditching it for the jQuery/ajax return JSON approach. The reasons why:
Coldbox way = Handlers should be doing the work, not views
CFajax/cfselect was slower than jQuery ajax, and with less options. (What if I want a multiple select box? Or three data attributes returned rather than two?)
I didn't want to use the cfform tag in my view, which cfselect requires
I can post the jQuery ajax way if needed, but I think I answered the original question