Ok,

I'm done for today, doing this kind of mistakes it's a good way to realize that 
I need to rest. 

Thanks Sean and sorry for the noobish question.

João Fernandes
Sistemas de Informação

Programador Informático
Cofina media

Avenida João Crisóstomo, Nº 72 . 1069-043 Lisboa PORTUGAL
Tel (+351) 213 185 200 . Fax (+351) 213 540 370
[EMAIL PROTECTED]

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sean Corfield
Sent: quarta-feira, 8 de Março de 2006 18:44
To: [email protected]
Subject: Re: [Reactor For CF] Am I blind or drunk?

On 3/8/06, João Fernandes <[EMAIL PROTECTED]> wrote:
> I'm trying to fill my record dynamically but setting something like this:
>
> <cfset funct = myRecord["set#myvar#"]> <cfset funct(myvalue)>
>
> I'm getting this
>
> Variable _getTo is undefined.

Correct. When you extract a method from a CFC like that, the call executes in 
the context of *your* code, not the context of the CFC. In other words it 
behaves just like a UDF. The name lookup in ColdFusion is dynamic so when 
_getTo is looked up, it will happen in the context of *your* code since the 
function is being executed outside the CFC!
That's not a Reactor issue.

Use <cfinvoke> to call a dynamic method:

<cfinvoke component="#MyRecord#" method="set#MyVar#">
    <cfinvokeargument name="#MyVar#" value="#myvalue#" /> </cfinvoke>
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

 

-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/


t/





-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/


Reply via email to