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]

Reply via email to