[Seaside] WAValidationDecoration>>handleAnswer: shouldn't use super handleAnswer?

Avi Bryant avi at beta4.com
Tue Jun 22 05:25:07 CEST 2004


On Jun 21, 2004, at 7:07 PM, C. David Shaffer wrote:

> In Seaside 2.5a5 the implementation of 
> WAValidationDecoration>>handleAnswer: consults the super classes 
> version of this method which looks at the owner but shouldn't a 
> validation decoration do something more like:
>
> handleAnswer: anObject
>    (self validate: anObject) ifTrue: [^super handleAnswer: anObject].
>    ^true

Well, the idea was that the decorations closest to the component got to 
handle the event first - this mimics the previous exception-based 
behavior.  So you want to give the owner a chance first, and only if it 
returns false (unhandled) do you do anything at all.  This should, of 
course, be pulled up into a superclass so it doesn't have to be in 
every implementation of #handleAnswer:.  I also wouldn't mind something 
better than the boolean return value, which takes some effort to keep 
straight (what does returning "true" mean again?).

Note that the AnswerDecoration that will actually answer the value is 
outermost, so calling super won't trigger it - only returning false 
will.

Avi



More information about the Seaside mailing list