Title: Message
Did you not try the cfinvoke method? That _will_ work.
 
 

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
Member of Team Macromedia

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joe Eugene
Sent: Tuesday, June 17, 2003 1:59 PM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] Dynamic CFC Calls

Thanks Samuel... but that does NOT work.
 
The only way i can get it to work is using an evaluate.... and i really dont want to use "evaluate"
 
 variables.execMethod="request."&variables.varClass&"."&variables.varMethod;
 '#variables.varName#'= evaluate(variables.execMethod);
 
Your Code...
 variables[varName] = request[variables.varClass][variables.varMethod](); // Complains about "()"
 
The compiler complains about the "()" at the end... can u get it to work?
 
Thanks
Joe Eugene
 
 
 
----- Original Message -----
Sent: Tuesday, June 17, 2003 3:45 PM
Subject: RE: [CFCDev] Dynamic CFC Calls

two ways, 
 
1.
 
request.dataObj = createObject("Component","Website/MyData");
 
varObj="dataObj";
varMethod="getStateData"; // removed the parens
varName="someData";
 
variables[varName] = request[varObj][varMethod]();
 
2.
 
<cfinvoke component="#request[varobj]#" method="#varMethod#" returnVariable="#varName#">
 
 
Untested but both should work.
 
hth,

Sam
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Joe Eugene
Sent: Tuesday, June 17, 2003 3:38 PM
To: [EMAIL PROTECTED]
Subject: [CFCDev] Dynamic CFC Calls

Anybody know how to dynamically call methods in CFC's
 
<cfscript>
request.dataObj = createObject("Component","Website/MyData");
 
varObj="dataObj";
varMethod="getStateData()";
varName="someData";
 
 
// Now, i want to be able to call the CFC Dynamically, something like
 
'#varName#'=request["#varObj#"]["#varMethod#"];
 
//.#varMethod# doesnt work either.
 
</cfscript>
 
I am getting the below from the above code.
"Element getleftNavLinks is undefined in a Java object of type class coldfusion.runtime.TemplateProxy referenced as"
 
What am i missing?..
 
Thanks
Joe Eugene

Reply via email to