Adam,
As Sean stated, this is a known issue. Here is one way that should work
around the issue:
=================================================
<cfcomponent name="parent">
<cffunction name="f" output="true" returntype="boolean">
PARENT<br />
<cfdump var="#arguments#">
<cfreturn true>
</cffunction>
</cfcomponent>
=================================================
<cfcomponent nam="child" extends="parent">
<cffunction name="f" output="true" returntype="boolean">
<cfset var ret = true>
<cfset var key = "">
CHILD<br />
<cfinvoke component="super" method="f" returnvariable="ret">
<cfloop collection="#arguments#" item="key">
<cfinvokeargument name="#key#" value="#arguments[key]#"/>
</cfloop>
</cfinvoke>
<cfreturn ret/>
</cffunction>
</cfcomponent>
Call component method here:
=================================================
<cfinvoke component="child" method="f" arg1="value1" arg2="value2">
I hope this helps.
Paul Kenney
WebMaster, CorporateWarriors.com
916-663-1963
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Adam Cameron
Sent: Wednesday, January 21, 2004 8:52 PM
To: [EMAIL PROTECTED]
Subject: [CFCDev] Calling SUPER methods
[sigh: I'm not really liking CFMX much today :-(
OK.
Next issue that's getting right on my tits.
"Cannot invoke method f on an object of type coldfusion.runtime.Struct
with named arguments.
Use ordered arguments instead."
This is when I do this:
=== PARENT.CFC ===
<cfcomponent>
<cffunction name="f" output="true" returntype="boolean">
PARENT<br />
<cfdump var="#arguments#">
<cfreturn true>
</cffunction>
</cfcomponent>
=== CHILD.CFC ===
<cfcomponent extends="parent">
<cffunction name="f" output="true" returntype="boolean">
CHILD<br />
<cfreturn super.f(argumentCollection=arguments)>
</cffunction>
</cfcomponent>
=== CALLER.CFC ===
<cfinvoke component="child" method="f" arg1="value1" arg2="value2">
This is a very simplified test case of a more complex situation I've
encountered this in.
I get exactly the same results if I specify a <cfargument> tag for the
arguments (which I cannot do in my live situation anyhow). Or if I try
- desperately - to *individually* name the arguments.
What the hell?
1) Why not? What's different about the handling of argument data when a
method is called direct, cf calling it as a super method? (not very
blimin' *super* at all, in my opinion ;-)
2) How can I work around? I cannot guarantee the number of arguments
that the method will receive, so I cannot do something like:
super.f(arguments[1],arguments[2],arguments[3], [etc]) // it's the
"etc" that's the problem
AAAAAAAAARRRRRRRRRGGGGGGGGHHHHHHHHHHH!!!!!!!!!
Adam
(wondering where his PHP install has got to...)
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]