Joao,

Thanks for the explanation. Makes sense. What would I do if I wanted to add
additional validation? Before, I would just continue adding errors to the
ValidationErrorCollection object. What would I do now? Is it as easy as
overriding the validate() method (making sure to call
before/afterValidate()), and add my own checks?

Cedric

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of João Fernandes
Sent: Monday, July 03, 2006 9:25 AM
To: [email protected]
Subject: RE: [Reactor for CF] Validate records

Cedric,

You can check if there is errors using myRecord.hasErrors() after doing
myRecord.validate();
The _getErrorCollection().getErrors() will return an array of errors
occurred during validation.

 

João Fernandes
Dep. Informática - Área de Desenvolvimento
Cofina media

Avenida João Crisóstomo, Nº 72 . 1069-043 Lisboa PORTUGAL
Tel (+351) 213 185 200 . Fax (+351) 213 540 370
[EMAIL PROTECTED]


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Cedric Villat
Sent: segunda-feira, 3 de Julho de 2006 17:14
To: [email protected]
Subject: RE: [Reactor for CF] Validate records

Tom,

That's what I figured, but looking at the AbstractRecord object, validate()
returns void, which means I have no additional object I can tack errors
onto.

Does validate() throw an error when validate fails, or something?

Cedric

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Tom Chiverton
Sent: Monday, July 03, 2006 1:10 AM
To: [email protected]
Subject: Re: [Reactor for CF] Validate records

On Monday 03 July 2006 05:03, Cedric Villat wrote:
> Basically, I want to override the validate() method to add some 
> additional logic. What is the proper way of doing this with the latest 
> version of Reactor?

I would guess you create a method called 'validate', have it call
super.validate() and then do your additional checks.

--
Tom Chiverton



-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to