Thanks for the link. I tried going through the examples and from what I understand it will automatically inject any beans with maching setters. I added this to my coldspring config
<bean id="TDOBeanInjectorObserver" class="model.beanUtils.TDOBeanInjectorObserver" lazy-init="false"> <constructor-arg name="debug"><value>true</value></constructor-arg> <constructor-arg name="transfer"><ref bean="transfer" /></ constructor-arg> </bean> <bean id="Validator" class="model.validation.validator" factory- method="init" singleton="true"> </bean> And in my abstractTransferDecorator I have the following method. <cffunction name="setValidator" access="public" output="false" returntype="void"> <cfargument name="validator" type="any" required="false" hint="The Validator."> <cfset variables.instance.validator = arguments.validator> </cffunction> Am I doing something wrong? I am getting the following error when I try to call my getValidator() method. Element INSTANCE.BEANINJECTOR is undefined in VARIABLES. 127 : <cffunction name="getBeanInjector" access="public" returntype="any" output="false" hint="I return the BeanInjector."> 128 : <cfreturn variables.instance.beanInjector /> 129 : </cffunction> On Jun 4, 9:54 am, "James Allen" <slingsho...@googlemail.com> wrote: > Hi Dan, > > This is what you need. Works really well > -http://www.briankotek.com/blog/index.cfm/2008/1/14/My-Transfer-Decora... > n-Injector-Observer-Is-Now-Available > > --- > James Allen > E: ja...@jamesallen.name > E: slingsho...@googlemail.com > Blog:http://jamesallen.name > Twitter: @CFJamesAllen (Coldfusion / Web development) > Twitter: @jamesallenuk (General) > > -----Original Message----- > From: transfer-dev@googlegroups.com [mailto:transfer-...@googlegroups.com] > > On Behalf Of Dan Vega > Sent: 04 June 2009 14:50 > To: transfer-dev > Subject: [transfer-dev] Injecting beans into decorators > > I am sorry if this is a dumb question but I am just getting started > with writing my own decorators. I have a Product decorator that > extends my base decorator like so. > > <cfcomponent displayname="Product Transfer Decorator" output="false" > extends="AbstractTransferDecorator"> > > <cffunction name="configure" access="public" output="false" > returntype="any"> > <cfargument name="validator" type="any" required="true"> > <cfset setValidator(arguments.validator)> > <cfreturn this> > </cffunction> > > </cfcomponent> > > From what I have read configure is called when the decorator is > instantiated. Normally when I set up my objects in coldspring I can > inject other dependencies but here I am a little lost. How do I pass a > validator bean that I setup in cs into this decorator. > > Thanks for the help! --~--~---------~--~----~------------~-------~--~----~ Before posting questions to the group please read: http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer You received this message because you are subscribed to the Google Groups "transfer-dev" group. To post to this group, send email to transfer-dev@googlegroups.com To unsubscribe from this group, send email to transfer-dev-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~----------~----~----~----~------~----~------~--~---