Don't forget argumentcollection as an alternative.
<cfset args = structNew() />
<cfset args.myVariable = "some value" />
<cfset args.myOtherVariable = "another value" />
<cfset myObject = createObject('component','myObject').init(myDSN) />
<cfset qry_Products = myObject.getProducts(argumentCollection=args) />
This method can be nice if you want to pass in an entire form. Say you have a search form. It's field names match those of the parameters in your search function in your CFC.
Then after instantiating you can do
<cfset qry_Products = myObject.getProducts(argumentCollection=Form) />
Excess Form Fields such as the Submit button or the FieldList are just ignored.
--
Matt Williams
"It's the question that drives us."
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
- Re: [CFCDev] Question About Invoking/Creating CFC Obje... Aaron Roberson
- RE: [CFCDev] Question About Invoking/Creating CFC Objects Dave Watts
- Re: [CFCDev] Question About Invoking/Creating CFC Obje... Aaron Roberson
- Re: [CFCDev] Question About Invoking/Creating CFC ... Aaron Roberson
- Re: [CFCDev] Question About Invoking/Creating ... Aaron Roberson
- RE: [CFCDev] Question About Invoking/Creating CFC Objects Dave Watts
- RE: [CFCDev] Question About Invoking/Creating CFC Objects Nolan Erck
- Re: [CFCDev] Question About Invoking/Creating CFC Obje... Aaron Roberson
- RE: [CFCDev] Question About Invoking/Creating CFC ... Peter Bell
- Re: [CFCDev] Question About Invoking/Creating ... Matt Williams
- Re: [CFCDev] Question About Invoking/Creating ... Matt Williams
- RE: [CFCDev] Question About Invoking/Creat... Peter Bell
- Re: [CFCDev] Question About Invoking/... Aaron Roberson
- RE: [CFCDev] Question About Invok... Peter Bell
- RE: [CFCDev] Question About Invok... Jason Daiger
- RE: [CFCDev] Question About Invok... Peter Bell
- Re: [CFCDev] Question About Invoking/Creating ... Aaron Roberson
- RE: [CFCDev] Question About Invoking/Creat... Peter Bell
- Re: [CFCDev] Question About Invoking/Creat... Steve Bryant
