Can you pass a session variable in a CFC bind?
I have a page (dsp_compReqSCM.cfm) that (via a session variable) displays an application value. From this page (via a CFFORM) I would like to have that session variable passed along to a cfc(getDistinct.cfc). I can't quite get the syntax correct and am hoping to get some assistance. When I code #session.this_appl# in dsp_ReqComps.cfm, I get an error stating Element not found PTS (which is the value of session.this_appl) and that the bind cannot occur. If I pass session.this_appl (NO ##) in dsp_ReqComps.cfm, I get an error stating Element not found session and that the bind cannot occur. If I pass 'session.this_appl' or "session.this_appl" in dsp_ReqComps.cfm, I get an error stating Element not found 'session (or "session) and that the bind cannot occur.
dsp_compReqSCM.cfm calls dsp_ReqComps.cfm via cfform
<!---dsp_ReqComps.cfm--->
<cfwindow initshow="true" center="true" width="430" height="340">
<cfform>
<cfgrid name="componentsGrid"
format="html"
pagesize=10
striperows="yes"
bind="cfc:distinctComponents.getDistinct({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},#session.this_appl#})"
selectmode="row" >
<cfgridcolumn name="Component_type" header="Component Type" width="400">
</cfgrid>
</cfform>
</cfwindow>
<!---getDistinct.cfc--->
<cfcomponent>
<cffunction name="getDistinct" access="remote" returntype="struct">
<cfargument name="page">
<cfargument name="pageSize">
<cfargument name="gridsortcolumn">
<cfargument name="gridsortdir">
<cfargument name="appl_in" type="string" required="true">
<cfset var Qcomponents = ''>
<cfif gridsortcolumn EQ "">
<cfset gridsortcolumn = "ASC">
</cfif>
<cfif gridsortdir EQ "">
<cfset gridsortdir = "ASC">
</cfif>
<cfquery name="Qcomponents" datasource="Tax">
select DISTINCT(component_type) from ctl_components
where app_abbrev = #appl_in#
</cfquery>
<cfreturn QueryConvertForGrid(Qcomponents, page, pageSize)>
</cffunction>
</cfcomponent>
Any advice you can give is greatly appreciated!
Libby H.
