Say you have the following abc.cfc :

<cfcomponent>
...
 <cffunction name="x">
  <cfargument name="a">
  <cfargument name="b">
  <cfargument name="c">
  <cfargument name="d">
...
</cffunction>
...
</component>

Ang you going to invoke in from somewhere else. Depending on the situation,
sometimes you'll have different combinations of the arguments (for example
maybe your using the same function to run some user search for both a simple
and advanced mode) . Using argumentCollection, you can avoid the hassle of
having to pass in blank values so that the positioning is right - you would
doing something like:
<cfset i = structnew()>
<cfif simple_case>
 <cfset i["a"] = form_imput_A>
<cfelse>
 <cfset i["b"] = form_imput_B>
 <cfset i["c"] = form_imput_C>
 <cfset i["d"] = form_imput_D>
</cfif>
<cfset results =
createobject("component","path_to_cfc.abc").x(argumentCollection=i)>

That certainly isn't an in depth example... but hope it helps some!


On Thu, Dec 30, 2010 at 4:52 PM, Matthew Nicholson <
matthew.nichol...@soltech.net> wrote:

> Afternoon All!
>
>
>
> Here’s my basic dilemma. I’m enhancing a CF application that needs a whole
> lot of TLC. With that, I’m attempting to redesign a few aspects of the
> application to use components to keep with good design principles.
>
>
>
> Now, I think I’m being exceptionally thick headed but I can’t for the life
> of me figure a way to pass as argumentCollection into my component and then
> utilize its information.
>
>
>
> Does anyone have a good resource or tutorial on how to do this? I’ve found
> plenty that talk of using the argumentCollection but none of them illustrate
> it’s use within the component.
>
>
>
> Thank you very much for your time and expertise!
>
>
>
> *Matthew R. Nicholson*
>
> *SolTech, Inc.*
>
> *Cell: 770-833-5326*
>
> *www.soltech.net*
>
> To find what you seek in the road of life, the best proverb of all is that
> which says: "Leave no stone unturned."
>       ~Edward Bulwer Lytton
>
>
>
> -------------------------------------------------------------
> To unsubscribe from this list, manage your profile @
> http://www.acfug.org?fa=login.edituserform
>
> For more info, see http://www.acfug.org/mailinglists
> Archive @ http://www.mail-archive.com/discussion%40acfug.org/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------

Reply via email to