The way ColdSpring does this is simpler: The init() of your CFC takes a dsnBean as an argument. In that init() you simply set variables.dsnBean = arguments.dsnBean. You can then use it directly from the variables scope;
<cfquery name="test" datasource="#variables.dsnBean.getName()#" ... mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ 2009/7/26 Glyn Jackson <[email protected]>: > > Hi, I have my DNS bean injected into my CFC, I have used a setter. how do I > now use the dns details now 'within' my CFC. do I create it in my init > method? I want to do something like the following... > <cfquery name="test" datasource="#instance.dsn.getName()#" etc. > > -------------------------------------------------------------------------- > <cffunction name="getdsnBean" access="public" returntype="any" > output="false" hint="Return the dnsBean."> > <cfreturn instance['dns'] /> > </cffunction> > > <cffunction name="setdsnBean" access="public" returntype="void" > output="false" hint="Set the dsnBean."> > <cfargument name="dsnBean" type="any" required="true" hint="dsnBean" /> > <cfset instance['dsn'] = arguments.dsnBean /> > > </cffunction> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324970 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

