Thanks Nolan. I didn't even think of doing it like that.

Ben

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Nolan Erck
Sent: Thursday, May 06, 2004 2:54 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] passing Form fileds as arguments

What I do is...

<cfset variables.createOrder =
application.vantage2DS.customerExists( form ) />

...then in my CFC/method...

<cfargument name="tFormFields" type="struct" />

...and reference the form fields like this:

tFormFields.emailAddress, tFormFields.firstName, etc.

If your CFC is getting called as a web service, there is a bug with how
the form scope is created.  You'll have to use Duplicate() like so:

<cfset variables.createOrder =
application.vantage2DS.customerExists( Duplicate( form ) ) />

Sean Corfield has some info about this on his blog from a few days ago.
(http://www.corfield.org/blog/past/2004_04.html#000411)

hth,
Nolan




-----Original Message-----
From: Ben Densmore [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 06, 2004 11:50 AM
To: [EMAIL PROTECTED]
Subject: [CFCDev] passing Form fileds as arguments


I searched through the archives and couldn't find anything directly
related but if this has been asked before I apologize.

If I have say 20 form fields that are submitted and then need to pass
them in as arguments to a function in a cfc am I better off doing
something like:

<cfset variables.createOrder =
application.vantage2DS.customerExists(form.emailAddress,form.firstName,f
orm.lastName) />

Or is this considered better?

<cfset variables.fNames = structNew() />

 <cfset variables.fNames.emailAddress = form.emailAddress />
 <cfset variables.fNames.firstName = form.firstName />
 <cfset variables.fNames.lastName = form.lastName />

<cfset variables.createOrder =
application.vantage2DS.customerExists(variables.fNames) />


I know both work, I have kind of gotten used to using getters and
setters with an event bean in Mach-II but the application I'm working on
now I'm not using Mach-II and to my knowledge cfc's don't have anything
like an event bean. 

Thanks,
Ben


----------------------------------------------------------
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]
----------------------------------------------------------
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]

Reply via email to