Joe, I haven't tested this, but I know that if you do

<cfset x = this.foo()>

inside a CFC, the "this" portion makes the call act as if it were
external, so if FOO was marked ACCESS=PRIVATE, it wouldn't work. Your
code below may have the same problem. Note - MAY.

On Fri, 30 Jul 2004 11:36:15 -0400, Joe Rinehart <[EMAIL PROTECTED]> wrote:
> Hi,
>
> It's not that you don't want to not set the component attributes;
> rather, you'd want to set the component attribute as a reference to
> itself.  I.e.:
>
> <cfinvoke method="myMethod" component="#this#">
>
> However, the preferred way to do this is just to do <cfset myMethod()>
> or <cfscript>myMethod();</cfscript>.
>
> If you do this:
>
> <cfinvoke method="myMethod" component="myComponent", you'll
> instantiate another instance of the component and run its myMethod,
> not the one inside the parent.  In the wrong place, this could lead to
> a nasty loop...
>
> -joe
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to