<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-15">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2657.73">
<TITLE>RE: [Seaside] How to do validation such as for money (with a currencyclass) in WAEditDialog subclasses?</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>&gt; On Fri, 29 Oct 2004 21:44:52 +0800, Yar Hwee Boon </FONT>
<BR><FONT SIZE=2>&gt; &lt;hboon@motionobj.com&gt;&nbsp; </FONT>
<BR><FONT SIZE=2>&gt; wrote:</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; &gt; However, how do I validate input which is non-digit? The #amount:</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; Just to clarify, I mean how do I valiate short of using Javascript.</FONT>
</P>

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

<P><FONT SIZE=2>Did you have a look to Mewa ? It does validation using another</FONT>
<BR><FONT SIZE=2>technique where you have a meta-wrapper for every aspects of</FONT>
<BR><FONT SIZE=2>the domain object. But again the domain object is not updated</FONT>
<BR><FONT SIZE=2>directly.</FONT>
</P>

<P><FONT SIZE=2>Hope this helps,</FONT>
<BR><FONT SIZE=2>Michel.</FONT>
</P>

</BODY>
</HTML>