Just realized I left out the pound signs:

<cfinvoke component = "#application.aImage#"
method = "#b#"
returnVariable = "z"
argumentCollection = "#arguments#">

If you want the CFC to be dynamic as well, you can use something like
#application[targetCFC]#, where targetCFC is the variable holding the name
of the application-scoped CFC you want to invoke.

On 9/12/07, Brian Kotek <[EMAIL PROTECTED]> wrote:
>
> <cfinvoke component = "application.aImage"
> method = "#b#"
> returnVariable = "z"
> argumentCollection = "#arguments#">
>
> On 9/12/07, Andrew Grosset <[EMAIL PROTECTED]> wrote:
> >
> > I have a cfc in the application scope and I access it like so:
> >
> > <cfset application.aImage.updateIm(argumentCollection=q)>
> >
> > I would like to be able to pass in the cfc name (in this case "myImage")
> > and the method/function ("adateIm") dynamically.
> >
> > If I try this, I get an error: " A CFML variable name cannot end with a
> > "." character"
> > <cfset a = "aImage">
> > <cfset b = "updateIm">
> > <cfset application.#a#.#b#(argumentCollection=q)>
> >
> > I also tried this but then it fails again as updateIm calls another
> > function within "aImage.cfc" and it can't see/access it:
> >
> > <cfset z = application[a][b]>
> > <cfset z(argumentCollection=q)>
> >
> > This works but I'm not accessing the cfc in the application scope which
> > rather defeats the purpose of writing it into the application scope.
> >
> > <cfobject component = "mycfcs.#a#" name = "test">
> >
> > <cfinvoke  component = "#test#"
> > method = "#b#"
> > returnVariable = "z"
> > argumentCollection = "#arguments#">
> >
> > Is there a way to access the cfc and method stored in the application
> > scope and pass in the cfc name and method dynamically?
> >
> > Andrew
> >
> >
> > 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288332
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to