<cfset myobj = application.reactor.createRecord("myrecord")>
<cfdump var="#myobj#">
Dumps just fine my record object
<cfdump var="#myobj.myfunction#">
Dumps fine the function too
<cfinvoke object="#myobj#" method="myfunction" >
<cfinvokeargument name="myvar" value="myvalue">
</cfinvoke>
Hummmm.... I get:
Entity has incorrect type for being called as a function.
The symbol you have provided "myfunction" is not the name of a function.
I don't know why I keep trying...
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 Doug Hughes
Sent: quarta-feira, 8 de Março de 2006 19:16
To: [email protected]
Subject: RE: [Reactor For CF] Am I blind or drunk?
Noob? Ha! I didn't know the answer. That's why Sean has to fix my
mistakes. ;)
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of João
Fernandes
Sent: Wednesday, March 08, 2006 1:49 PM
To: [email protected]
Subject: RE: [Reactor For CF] Am I blind or drunk?
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/
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/