On 4/18/07, Steve Onnis <[EMAIL PROTECTED]> wrote:
> Yeah I know how to call a CFC.  With CFARGUMENT though if I am passing a
> custom type into it how does the CFC know what to do?

If you look at http://livedocs.adobe.com/coldfusion/7/htmldocs/00000218.htm
(cfargument tag), in the description of "type" the table of attributes
you'll see the very last point says:-

     a component name: if the type attribute value is not one of the
preceding items, ColdFusion treats it as the name of a ColdFusion
component. When the function executes, it generates an error if the
argument that is passed in is not a CFC with the specified name.

Remember, when you create an instance of a cfc, cfdump will tell you
the name of underlying cfc. So when you state that the type is of a
specific cfc, cf will validate the type of the instance against the
type required in the cfargument tag.

> <cfargument name="myList" required="No" type="MyNurmericList" />
>
> ---CFC--
> <cfcompoent>
>         // what goes in here?
> </cfcomponent>

Firstly properties to store the value of the numeric list and secondly
methods to set, validate and retrieve a numeric list

> Or do you call it like....
>
> <cfargument name="myList" required="No"
> type="#MyNurmericList.isValid(arguments.myList)#" />

No, the value of type must be the name of a type as a string.

> This is the bit I don't get because usually you would call a method in the
> CFC but the docs say they custom type is a reference to a CFC

Since the type attribute is optional, you can pass anything and no
errors are generated. If specify the type attribute, the value you
pass it must of that type of an error is generated due to the type
mismatch.


Chris
-- 
Chris Velevitch
Manager - Sydney Flash Platform Developers Group
m: 0415 469 095
www.flashdev.org.au

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to