Replace:
  result = obj[ thisFunction.name ]( argumentCollection = form )

with this:
<cfinvoke component="#obj#" method="#thisFunction.name#"
argumentCollection="#form#" returnvariable="result"/>

It should do what you need.

On Tue, 13 Jul 2004 22:10:15 +1000, Robin Hilliard
<[EMAIL PROTECTED]> wrote:
> Taco Fleur wrote:
> > How do I get this to work?
> > Problem is described in the comments.
> >
> > <cfscript>
> > // create the object
> > obj = createObject("component", "indexServer");
> >
> > // get the meta data of the CFC
> > objMetaData = getMetaData(obj);
> >
> > // if we need to display an input form
> > if ( isDefined("url.display") )
> > {
> >         // get the function
> >         thisFunction = objMetaData.functions[ url.display ];
> > }
> >
> > // if we need to execute the method
> > if ( isDefined("form.btnExecute") )
> > {
> > *        // assign the result * * * * * * * this is where I get an
> > error, the error says "Invalid CFM construct" and points to this line *
> > * * * * * **
> >
> >         result = obj[ thisFunction.name ]( argumentCollection = form );
> > }
> > </cfscript>
> 
> Taco,
> 
> I assume url.display contains a number (since functions is an array).
> It's probably complaining about the combination of [] and () together,
> if you wrote
> 
> x = obj[thisFunction.name];
> result = x(...
> 
> it should work. This said, you should also know the structure returned
> by getMetaData is a bit funny - it's more a scope (static to the
> component's class - you can add keys to it, then retrieve them using
> getMetaData on another instance of the same component) than a structure,
> and refering to things in it via an interim variable (thisFunction in
> your case) sometimes does strange things - this could be contributing
> to your problem.
> 
> Robin
> 
> 
> --
> Robin Hilliard
> Partner
> RocketBoots Pty Ltd
> Professional Services for Macromedia Technologies
> m       +61 418 414 341
> f       +61 2 9798 0070
> e       [EMAIL PROTECTED]
> 
> 
> 
> ---
> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to [EMAIL PROTECTED]
> Aussie Macromedia Developers: http://lists.daemon.com.au/
> 


-- 
Paul Kenney
[EMAIL PROTECTED]

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to