Another thing to consider is that you dont need to put Component="#this#"
inside cfinvoke. If component is empty and its inside a CFC it knows it is
a call to its on instance. So this is a valid call:
<cfinvoke method="setInfo" info="#arguments#" />
Also since their is only one argument which is a structure you could also
call like this:
<cfset this.setinfo(arguments)>
Well at least thats how I have been doing it.
Brendan
<[EMAIL PROTECTED]>@cfczone.org on 09/22/2003 10:47:59 AM
Please respond to [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
To: <[EMAIL PROTECTED]>
cc:
Subject: [CFCDev] cfc question
I've snipped out a piece of code from the contact manager example in
MachII. I was studying this as an example for building a current app. I'm
concerned about this line
<cfinvoke component="#this#" method="setInfo" info="#arguments#" />
I see what its doing, but does this not create a new 'instance' of the
component? So If say we have
obj = CreateObkect("component", "contact.cfc");
obj.init(...arg list...);
does the second line not create a new instance of contact.cfc when init()
is called? or is init() not called in M2 apps at all?
<cfcomponent>
<cfset variables.id = ""&CreateUUID() />
<cfset variables.firstName = "" />
<cffunction name="init">
<cfargument name="firstName" type="string" required="true" />
<cfinvoke component="#this#" method="setInfo" info="#arguments#" />
</cffunction>
<cffunction name="setInfo" access="public">
<cfargument name="info" type="struct" required="true" />
<cfset setFirstName(arguments.info.firstName) />
</cffunction>
---->dugOUT ���
"When I was kidnapped, my parents snapped into action. They rented out my
room." -- Woody Allen
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word '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 word '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]