Yup, checked all that. If I define them as variables. they don't work.
Move them into the cffuction area and var them and they work fine.  The
method are access=public.  Constructor returns THIS. I would instantiate
them in a application scope but I don't want to do that JUST yet.  BTW,
what is the drawn back of defining a ton of objects into the application
scope? (i.e. making a factory and defining the global used methods in
the application.cfc?)

Here's the error msg container code:
<cfcomponent displayname="errorMessages" output="false" hint="An error
Auditor. Grabbing and using an Array">
        <cfset variables.instance = arrayNew(1)>

        <cffunction name="init" access="public"
returntype="errorMessages" hint="Constructor">
                <cfreturn this />
        </cffunction>

        <cffunction name="addErrorMsg" access="public" returntype="any">
                <cfargument name="message" required="yes" default="">
                
                <cfif len(trim(arguments.message))>
                        <cfset arrayAppend(variables.instance,
arguments.message) />
                </cfif>

                <cfreturn variables.instance />
        </cffunction>

        <cffunction name="isSuccess" access="public"
returntype="boolean">
                <cfif arrayLen(variables.instance)><cfreturn false />
                <cfelse><cfreturn true /></cfif>
        </cffunction>

        <cffunction name="getErrors" access="public" returntype="array">
                <cfreturn variables.instance />
        </cffunction>
</cfcomponent>

> -----Original Message-----
> From: Charlie Stell [mailto:charlie.st...@gmail.com] 
> Sent: Wednesday, November 25, 2009 1:03 PM
> To: cf-talk
> Subject: Re: Methods not found.
> 
> 
> Id check the following:
> 
> That your referring to the CFC in the same way you are 
> defining them. (since you say it works when defining with teh 
> functions, I think this is most likely)
> 
> The method-access on the other CFCs.
> 
> That the init function of external CFCs are returning "this".
> 
> You could also instantiate them into the application scope, 
> as long as they are thread-safe, and then refer to them via 
> the application scope.
> 
> Hope this helps!
> 
> >Gah, sorry.  The sample is wrong.  The psuedo constructor would look 
> >like this and in the cffunction would be called by the 
> variables scope.
> >variables.errorMsg.addErrorMsg()
> >
> >Sorry. was copy/pasting.
> >
> ><cfcomponent displayname="feeds" output="false" ...>
> >  <cfscript>
> >    variables.errorMsg = createObject("component", 
> >"com.util.errorMessages").init();
> >    variables.iManager = createObject("component", 
> >"com.util.imageManager").init();
> >    variables.instGateway = createObject("component", 
> >"FeedsGateway").init(application.global);
> >  </cfscript>
> >
> >> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:328708
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to