In addition to the suggestion of passing FORM as a single struct argument,
you should check out the ARGUMENTCOLLECTION special argument.

Then you could say:

myCFC.myMethod(argumentCollection=form);

That would be equivalent to:

myCFC.myMethod(form.foo,form.bar,....)

Which you choose will depend on the nature of the particular method in
question and other uses it might have outside the context of a FORM scope
being used to generate the arguments.


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Ben Densmore
> 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]

Reply via email to