<nodding vigorously> Cool stuff and good to know. My inner toddler has found her pacifier. Thanks, Ray.
-Patti On 7/17/02 5:08 PM, "Raymond Camden" <[EMAIL PROTECTED]> wrote: >> Now explain <cfproperty>. In the example below, for example, >> what would be different if you made ID a property of the >> human object rather than a non-var local variable? > > > When using CFCs, <cfproperty> does absolutely nothing. It can be used to > help describe web services, but strictly speaking for CFCs, they don't > do anything... except... > > You can use <cfproperty> to define metadata for the CFC. For example, I > may do this in my CFC: > > <cfproperty name="age" type="numeric"> > <cfset this.age = 0> > > Now if I call getMetaData on the CFC, I will see age as a property. > > What's cool is that I can write a validation routine that says: > > Since Age is defined as Numeric, look at this.age. Is it numeric? If > not, throw an error. > > I have a general purpose UDF that allows you to use <cfproperty> in your > CFC and then perform validation on the object data. (It even recurses up > the inheritance.) > > Does that help? By the way, you can even do stuff like: > > <cfproperty name="age" type="numeric" range="1,90" ray=1> > > Both range and ray will show up in the metadata and you can use them as > you see fit. > >> In that case would ID be something that *is* >> viewable/changeable by the user (which would be a bad idea > > No. CFPROPERTY will not change how the value ID is visible. It shows up > in the metadata as a property, but the VALUE doesn't. > > ======================================================================= > Raymond Camden, ColdFusion Jedi Master for Macromedia > > Email : [EMAIL PROTECTED] > Yahoo IM : morpheus > > "My ally is the Force, and a powerful ally it is." - Yoda > > ______________________________________________________________________ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

