[Seaside] How to do validation such as for money (with a curr encyclass) in WAEditDialog subclasses?

Bany, Michel mbany at cincom.com
Fri Oct 29 16:23:57 CEST 2004


> On Fri, 29 Oct 2004 21:44:52 +0800, Yar Hwee Boon 
> <hboon at motionobj.com>  
> wrote:
> 
> > However, how do I validate input which is non-digit? The #amount:
> 
> Just to clarify, I mean how do I valiate short of using Javascript.

I think your should not update your domain objects directly.
I would use the command pattern, i.e. the model of your
Seaside component should be a command. You would collect
all the command data using the callbacks of your component
Then the callback attached to the OK button would send #execute
to the command object. Assuming that #execute performs the
validation, you would get an exception describing the error(s).
On the next rendering, you would alter the display to using
the error description(s).

Did you have a look to Mewa ? It does validation using another
technique where you have a meta-wrapper for every aspects of
the domain object. But again the domain object is not updated
directly.

Hope this helps,
Michel.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20041029/f638dbbe/attachment.htm


More information about the Seaside mailing list