[Seaside] Catching Error in WAValidationDecoration

Avi Bryant avi at beta4.com
Mon Jun 21 20:13:23 CEST 2004


On Jun 21, 2004, at 9:06 AM, C. David Shaffer wrote:

> I'm sure I don't need to expound upon problems with raising and 
> catching generic errors.  Maybe WAValidationDecoration is just 
> intended as an example of using a decoration but I'm afraid many 
> people will use it and become frustrated.  I suggest the obvious: add 
> a new exception class for validation errors and implement 
> Object>>#validationError: to raise it.  Sample code, though trivial, 
> is attached.  Also, to attach the validation delegate you'll need to 
> override validateWith: in your component class(es):
>
> validateWith: aBlock
>    self
>        addDecoration: (SCValidationDecoration new validateWith: aBlock)
>
> I'd be happy to rewrite this as a .cs which modifies the "WA" base 
> classes and updates all of the existing examples...if there was a 
> chance it would be changed in the base distribution.

Definitely.  Thanks.
Maybe WAValidationDecoration should have a configurable exception class 
that it's looking for?  That way if someone's domain model doesn't use 
Seaside's validation error, it would still work.

Avi



More information about the Seaside mailing list