Andrew

Thanks

That’s what I wanted to know.

Steve 

-----Original Message-----
From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Andrew Scott
Sent: Wednesday, 18 April 2007 1:51 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Re: Custom CFC Argument Types


Steve,

To further clarify this with you, the answer is that you can only type it
against a known type. Now as Chris has pointed out that you can make the
type a CFC object but this doesn't validate for you, that's impossible to
achieve, without calling a specific method yourself to do the validation for
you.

So in short, the answer you had been looking for is NO it is not possible to
do. But it is possible to make sure the passed object is validated first,
then you can validate the contents.



Andrew Scott
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613  8676 4223
Mobile: 0404 998 273



-----Original Message-----
From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Chris Velevitch
Sent: Wednesday, 18 April 2007 12:49 PM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Re: Custom CFC Argument Types


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