Yeah, it creates and returns an ErrorSet object.  Validate creates an
ErrorSet, populates it as needed, and then stores it in the object's
instance state for later recall with getValidationErrors.  It also
returns it, since that's usually what the calling code wants.  Each
time validate is called and any of the instance data has changed, it
creates a new set and populates it.  Obviously if no state has
changed, there's no need to do the whole validation routine (with a
new notable exceptions, such as uniqueness checks).

function validate() {
  var errorSet = new ErrorSet();
  // check field X
  // check field Y
  variables.errorSet = errorSet;
  return errorSet;
}

cheers,
barneyb

On 10/30/05, Scratch <[EMAIL PROTECTED]> wrote:
>
> Hey Barney,
>
> In your example does Customer.Validate() return an object? If so, was that
> object created inside the Validate() method?
>
> Baz
>

--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 100 invites.


----------------------------------------------------------
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