Hi Erick,

Components really shouldn't be modifying variables on the calling page
- they should be blind of the environment in which they're run.  What
if you wanted to use your component inside another component, instead
of a page?

Instead, you may want to have your page ask your component for new
values through a method made just for it, like getFirstName() for a
"person" component.

Cheers,

Joe



----- Original Message -----
From: erick calder <[EMAIL PROTECTED]>
Date: Thu, 26 Aug 2004 18:29:50 -0400
Subject: MX components accessing callerspace?
To: CF-Talk <[EMAIL PROTECTED]>

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________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to