general, CFCs should be independant of their environment, meaning they
don't use a caller scope (or any external scopes) at all. With custom
tags you can accept data with attributes, but the only way to "return"
data is to set a variable in the caller scope. With CFCs, on the
other hand, you can accept data (arguments) and return it (method
return value), so you shouldn't need the caller scope for anything.
It's definitely worth mentioning that CFCs don't make custom tags
obsolete. Far from it. Each fulfulls it's own purpose, and while
they are similar, they are complimentary not conflicting.
cheers,
barneyb
On Thu, 26 Aug 2004 18:29:50 -0400, erick calder
<[EMAIL PROTECTED]> wrote:
> MX components don't have access to the caller space so typically one has to do something like:
>
> x = CreateObject("component", "x");
> x.caller = caller;
>
> so that the component can set variables in the caller space like this:
>
> this.caller["whatever"] = true;
>
> This all works fine from a cutom tag, however
>
> x = CreateObject("component", "x");
> x.caller = variables;
>
> placed in the main page causes a stack overflow in MX. The reason is that
> however, the problem with this approach is that /variables/ contains /x/ so the assignment /x.caller = variables/ creates a circular reference.
>
> is there a better way to handle this? I need to be able to modify variables on the main page from a component.
>
> - e
>
--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

