<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Mold: Form Validation for Seaside</title>
	<atom:link href="http://kentreis.wordpress.com/2008/08/27/mold-form-validation-for-seaside/feed/" rel="self" type="application/rss+xml" />
	<link>http://kentreis.wordpress.com/2008/08/27/mold-form-validation-for-seaside/</link>
	<description>Pure and Simple</description>
	<lastBuildDate>Mon, 12 Oct 2009 20:32:35 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: RD</title>
		<link>http://kentreis.wordpress.com/2008/08/27/mold-form-validation-for-seaside/#comment-985</link>
		<dc:creator>RD</dc:creator>
		<pubDate>Thu, 13 Aug 2009 15:32:31 +0000</pubDate>
		<guid isPermaLink="false">http://kentreis.wordpress.com/?p=13#comment-985</guid>
		<description>Hello, I use Mold to generate the forms I use for an editor, but when I try to submit the corresponding fields using triggerForm: the values applied using mold save are always nil. What can be the reason for that?</description>
		<content:encoded><![CDATA[<p>Hello, I use Mold to generate the forms I use for an editor, but when I try to submit the corresponding fields using triggerForm: the values applied using mold save are always nil. What can be the reason for that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan Eggermont</title>
		<link>http://kentreis.wordpress.com/2008/08/27/mold-form-validation-for-seaside/#comment-940</link>
		<dc:creator>Stephan Eggermont</dc:creator>
		<pubDate>Wed, 13 May 2009 11:09:41 +0000</pubDate>
		<guid isPermaLink="false">http://kentreis.wordpress.com/?p=13#comment-940</guid>
		<description>Seaside issue: 64
replace trimBlanks by trimBoth</description>
		<content:encoded><![CDATA[<p>Seaside issue: 64<br />
replace trimBlanks by trimBoth</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan Eggermont</title>
		<link>http://kentreis.wordpress.com/2008/08/27/mold-form-validation-for-seaside/#comment-938</link>
		<dc:creator>Stephan Eggermont</dc:creator>
		<pubDate>Mon, 04 May 2009 11:51:07 +0000</pubDate>
		<guid isPermaLink="false">http://kentreis.wordpress.com/?p=13#comment-938</guid>
		<description>Seaside Issue: 337
replace storeCallback: by store: in Mold canvas:</description>
		<content:encoded><![CDATA[<p>Seaside Issue: 337<br />
replace storeCallback: by store: in Mold canvas:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cédrick</title>
		<link>http://kentreis.wordpress.com/2008/08/27/mold-form-validation-for-seaside/#comment-931</link>
		<dc:creator>Cédrick</dc:creator>
		<pubDate>Mon, 09 Feb 2009 12:20:42 +0000</pubDate>
		<guid isPermaLink="false">http://kentreis.wordpress.com/?p=13#comment-931</guid>
		<description>Hi Ken, 

I&#039;m also giving mold a try. I loaded it in seaside 2.9. No loading problem. On pharo, only #trimBlanks is missing. I used #trimBoth wich is definied in seaside (trim left and right blanks).

Problem is that validation doesn&#039;t occur. I changed #priority from 7 to 3 and now it seems to work.

Anyway thanks for sharing it.</description>
		<content:encoded><![CDATA[<p>Hi Ken, </p>
<p>I&#8217;m also giving mold a try. I loaded it in seaside 2.9. No loading problem. On pharo, only #trimBlanks is missing. I used #trimBoth wich is definied in seaside (trim left and right blanks).</p>
<p>Problem is that validation doesn&#8217;t occur. I changed #priority from 7 to 3 and now it seems to work.</p>
<p>Anyway thanks for sharing it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leandro</title>
		<link>http://kentreis.wordpress.com/2008/08/27/mold-form-validation-for-seaside/#comment-924</link>
		<dc:creator>Leandro</dc:creator>
		<pubDate>Thu, 04 Dec 2008 10:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://kentreis.wordpress.com/?p=13#comment-924</guid>
		<description>Hello Ken, I&#039;m giving a try to Mold. Do you have a mailing list or something like that to discuss mold related stuff?
I have some questions and I&#039;m sure more will arise..
thanks.</description>
		<content:encoded><![CDATA[<p>Hello Ken, I&#8217;m giving a try to Mold. Do you have a mailing list or something like that to discuss mold related stuff?<br />
I have some questions and I&#8217;m sure more will arise..<br />
thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramon Leon</title>
		<link>http://kentreis.wordpress.com/2008/08/27/mold-form-validation-for-seaside/#comment-912</link>
		<dc:creator>Ramon Leon</dc:creator>
		<pubDate>Sat, 30 Aug 2008 15:28:32 +0000</pubDate>
		<guid isPermaLink="false">http://kentreis.wordpress.com/?p=13#comment-912</guid>
		<description>No prob, and thanks, glad you like the blog.  I hope to see you blog more about Seaside, still not enough of us doing it, in depth at least.  If you have any more stuff you&#039;re considering writing up, please do, my Google Reader is starving for interesting Smalltalk content.</description>
		<content:encoded><![CDATA[<p>No prob, and thanks, glad you like the blog.  I hope to see you blog more about Seaside, still not enough of us doing it, in depth at least.  If you have any more stuff you&#8217;re considering writing up, please do, my Google Reader is starving for interesting Smalltalk content.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken Treis</title>
		<link>http://kentreis.wordpress.com/2008/08/27/mold-form-validation-for-seaside/#comment-911</link>
		<dc:creator>Ken Treis</dc:creator>
		<pubDate>Sat, 30 Aug 2008 05:08:44 +0000</pubDate>
		<guid isPermaLink="false">http://kentreis.wordpress.com/?p=13#comment-911</guid>
		<description>I thought of making a component like that, but I didn&#039;t want to force myself into subclassing that every time I wanted to build a form, especially if I&#039;m already at WAComponent &gt; MyAppComponent &gt; WizardStep &gt; ContactInfoStep or something like that. I tend to try to milk too much re-use out of the inheritance hierarchy anyway.

I could also imagine situations where it&#039;d be handy to have two molds within one form, though in practice I haven&#039;t done that much.

The canvas: setting bugs me too but I haven&#039;t found a better way around it yet. I considered using a WADynamicVariable, or passing the canvas around as an argument to every method along the way, but both of those just added annoying noise to the code. 

One other thing I forgot to mention about #customize: -- the other option for customization in Mold is to send messages to the tag returned by #widget: -- it&#039;s just a tag brush, so something like this is perfectly legit:

(mold widget: #email) size: 30.

You don&#039;t have this option when you&#039;re using the more broad-sweeping helper methods like #tableRows or #paragraphs, of course.

Again, thanks for the compliments. I have long admired your solid thinking and the clear explanations you write up on your blog, so it means a lot to me.</description>
		<content:encoded><![CDATA[<p>I thought of making a component like that, but I didn&#8217;t want to force myself into subclassing that every time I wanted to build a form, especially if I&#8217;m already at WAComponent &gt; MyAppComponent &gt; WizardStep &gt; ContactInfoStep or something like that. I tend to try to milk too much re-use out of the inheritance hierarchy anyway.</p>
<p>I could also imagine situations where it&#8217;d be handy to have two molds within one form, though in practice I haven&#8217;t done that much.</p>
<p>The canvas: setting bugs me too but I haven&#8217;t found a better way around it yet. I considered using a WADynamicVariable, or passing the canvas around as an argument to every method along the way, but both of those just added annoying noise to the code. </p>
<p>One other thing I forgot to mention about #customize: &#8212; the other option for customization in Mold is to send messages to the tag returned by #widget: &#8212; it&#8217;s just a tag brush, so something like this is perfectly legit:</p>
<p>(mold widget: #email) size: 30.</p>
<p>You don&#8217;t have this option when you&#8217;re using the more broad-sweeping helper methods like #tableRows or #paragraphs, of course.</p>
<p>Again, thanks for the compliments. I have long admired your solid thinking and the clear explanations you write up on your blog, so it means a lot to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramon Leon</title>
		<link>http://kentreis.wordpress.com/2008/08/27/mold-form-validation-for-seaside/#comment-910</link>
		<dc:creator>Ramon Leon</dc:creator>
		<pubDate>Fri, 29 Aug 2008 23:34:21 +0000</pubDate>
		<guid isPermaLink="false">http://kentreis.wordpress.com/?p=13#comment-910</guid>
		<description>Certainly there are similarities, they&#039;re both doing the same task, building forms.  The key difference is in the metadata and the html generation.  

Your metadata is generally specified in the view while building the mold using plain old objects, not that dissimilar from Magritte except of course it&#039;s in the model.  However, unlike Magritte, your metadata and the views that render the fields are one and the same while Magritte has a separate hierarchy of metadata (descriptions) and view components (overly complex IMHO).

Your mold views however, unlike Magritte, are pluggable, allowing a #customize: block to be sent to give you access to the tag while it&#039;s being generated, very nice as that sidesteps the need to have to subclass and customize the views (why I don&#039;t like Magritte&#039;s approach).  I do the same thing but using #respondsTo: and method naming conventions.  In either case, exactly what you need to Ajax&#039;ify up a form.

The only thing that seems off to me is the setting of the canvas on the mold and mold itself just being a helper class who does most of the work of the view.  Looking at it, I think I&#039;d make mold a subclass of WAComponent and do this...


Mold&gt;&gt;renderContentOn: html
    html := html.
    self renderMoldOn: html.

Mold&gt;&gt;renderMoldOn: html
    self subclassResponsibility


So the form itself is the mold and the view...


MyForm&gt;&gt;initialize
    &#124; email confirmEmail &#124;
    email := self emailField 
        key: #email; 
        label: &#039;Email Address:&#039;.
    confirmEmail := self emailField
        key: #confirmEmail;
        label: &#039;Confirm Email:&#039;.
    email 
        addCondition: [ :input &#124; input = confirmEmail input ] 
        labeled: &#039;Email addresses did not match.&#039;.
    confirmEmail 
        addCondition: [ :input &#124; input = email input ] 
        labeled: &#039;Email addresses did not match.&#039;.

MyForm&gt;&gt;renderMoldOn: html
    html form: 
        [ html table: [ self tableRows ] ].
        html submitButton
            value: &#039;Submit Form&#039;;
            callback: [ self isValid ifTrue: [ self save ] ] ]


But I could be overlooking some benefit of it being just a helper rather than the view.

In any case, I like your approach much better than Magritte because I think pluggable views are much easier to customize.  But keeping the metadata in the view does pose the problem of duplicating it across multiple views.

I do like your field hierarchy, it&#039;s much more OO feeling.  Mine is a single class with a copy of the domain object as a memento for holding possibly invalid state and extentions to all the #on:of: holders in Seaside adding #on:of:type: which runs any submitted values through a type converter class before writing to the model.  This class looks sort of like a visitor but the type name is used with reflection to invoke the correct conversion method.  So rather than creating my own hierarchy of tags, I just extended the tags in Seaside to be type aware and keep all the validations in the form class itself.  In any case, nice code, always enjoy seeing how someone else tackles a problem.

BTW, one of the reasons I like pragmas so much is that it&#039;s a cross platform approach, most languages support some form of pragma regardless of what they call them, so it allows me to work in a consistent style across C#, VB.Net, and Smalltalk by tagging metadata onto classes and using reflection to access it.</description>
		<content:encoded><![CDATA[<p>Certainly there are similarities, they&#8217;re both doing the same task, building forms.  The key difference is in the metadata and the html generation.  </p>
<p>Your metadata is generally specified in the view while building the mold using plain old objects, not that dissimilar from Magritte except of course it&#8217;s in the model.  However, unlike Magritte, your metadata and the views that render the fields are one and the same while Magritte has a separate hierarchy of metadata (descriptions) and view components (overly complex IMHO).</p>
<p>Your mold views however, unlike Magritte, are pluggable, allowing a #customize: block to be sent to give you access to the tag while it&#8217;s being generated, very nice as that sidesteps the need to have to subclass and customize the views (why I don&#8217;t like Magritte&#8217;s approach).  I do the same thing but using #respondsTo: and method naming conventions.  In either case, exactly what you need to Ajax&#8217;ify up a form.</p>
<p>The only thing that seems off to me is the setting of the canvas on the mold and mold itself just being a helper class who does most of the work of the view.  Looking at it, I think I&#8217;d make mold a subclass of WAComponent and do this&#8230;</p>
<p>Mold&gt;&gt;renderContentOn: html<br />
    html := html.<br />
    self renderMoldOn: html.</p>
<p>Mold&gt;&gt;renderMoldOn: html<br />
    self subclassResponsibility</p>
<p>So the form itself is the mold and the view&#8230;</p>
<p>MyForm&gt;&gt;initialize<br />
    | email confirmEmail |<br />
    email := self emailField<br />
        key: #email;<br />
        label: &#8216;Email Address:&#8217;.<br />
    confirmEmail := self emailField<br />
        key: #confirmEmail;<br />
        label: &#8216;Confirm Email:&#8217;.<br />
    email<br />
        addCondition: [ :input | input = confirmEmail input ]<br />
        labeled: &#8216;Email addresses did not match.&#8217;.<br />
    confirmEmail<br />
        addCondition: [ :input | input = email input ]<br />
        labeled: &#8216;Email addresses did not match.&#8217;.</p>
<p>MyForm&gt;&gt;renderMoldOn: html<br />
    html form:<br />
        [ html table: [ self tableRows ] ].<br />
        html submitButton<br />
            value: &#8216;Submit Form&#8217;;<br />
            callback: [ self isValid ifTrue: [ self save ] ] ]</p>
<p>But I could be overlooking some benefit of it being just a helper rather than the view.</p>
<p>In any case, I like your approach much better than Magritte because I think pluggable views are much easier to customize.  But keeping the metadata in the view does pose the problem of duplicating it across multiple views.</p>
<p>I do like your field hierarchy, it&#8217;s much more OO feeling.  Mine is a single class with a copy of the domain object as a memento for holding possibly invalid state and extentions to all the #on:of: holders in Seaside adding #on:of:type: which runs any submitted values through a type converter class before writing to the model.  This class looks sort of like a visitor but the type name is used with reflection to invoke the correct conversion method.  So rather than creating my own hierarchy of tags, I just extended the tags in Seaside to be type aware and keep all the validations in the form class itself.  In any case, nice code, always enjoy seeing how someone else tackles a problem.</p>
<p>BTW, one of the reasons I like pragmas so much is that it&#8217;s a cross platform approach, most languages support some form of pragma regardless of what they call them, so it allows me to work in a consistent style across C#, VB.Net, and Smalltalk by tagging metadata onto classes and using reflection to access it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken Treis</title>
		<link>http://kentreis.wordpress.com/2008/08/27/mold-form-validation-for-seaside/#comment-909</link>
		<dc:creator>Ken Treis</dc:creator>
		<pubDate>Fri, 29 Aug 2008 19:45:41 +0000</pubDate>
		<guid isPermaLink="false">http://kentreis.wordpress.com/?p=13#comment-909</guid>
		<description>Interesting approach too, I didn&#039;t realize you had moved beyond Magritte. I should check comments on your blog more often.

You said that yours is a very different approach, but I think the general approach is more similar than different. In both cases, there is a sort of specification declared (in pragmas, or in a buildMold method) and then there are helpers (your form builder class, or Mold&#039;s &quot;macros&quot; on the html canvas) that build and hook up the form while letting you override aspects of the rendering. For wizards, I&#039;m doing the same thing you are; and for custom validations, again it&#039;s the same approach: just implement the validation code in the form component.

Granted, I haven&#039;t looked at your code yet, so maybe I don&#039;t know what I&#039;m talking about. :) I guess the main underlying similarity I&#039;m seeing is that the model doesn&#039;t drive the process, it just assists in it.

The main difference here seems to be where you put the declaration. I&#039;m still not sold on metadata in the models, but I can see where your framework makes it easier to build multiple forms on top of the same model. Most of my forms end up asking the user for the same types of data, which is why Mold is built around a concept like &quot;now prompt them for a percentage&quot; rather than &quot;now prompt them for #completion, according to whatever its rules are&quot;.</description>
		<content:encoded><![CDATA[<p>Interesting approach too, I didn&#8217;t realize you had moved beyond Magritte. I should check comments on your blog more often.</p>
<p>You said that yours is a very different approach, but I think the general approach is more similar than different. In both cases, there is a sort of specification declared (in pragmas, or in a buildMold method) and then there are helpers (your form builder class, or Mold&#8217;s &#8220;macros&#8221; on the html canvas) that build and hook up the form while letting you override aspects of the rendering. For wizards, I&#8217;m doing the same thing you are; and for custom validations, again it&#8217;s the same approach: just implement the validation code in the form component.</p>
<p>Granted, I haven&#8217;t looked at your code yet, so maybe I don&#8217;t know what I&#8217;m talking about. :) I guess the main underlying similarity I&#8217;m seeing is that the model doesn&#8217;t drive the process, it just assists in it.</p>
<p>The main difference here seems to be where you put the declaration. I&#8217;m still not sold on metadata in the models, but I can see where your framework makes it easier to build multiple forms on top of the same model. Most of my forms end up asking the user for the same types of data, which is why Mold is built around a concept like &#8220;now prompt them for a percentage&#8221; rather than &#8220;now prompt them for #completion, according to whatever its rules are&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramon Leon</title>
		<link>http://kentreis.wordpress.com/2008/08/27/mold-form-validation-for-seaside/#comment-908</link>
		<dc:creator>Ramon Leon</dc:creator>
		<pubDate>Fri, 29 Aug 2008 18:52:33 +0000</pubDate>
		<guid isPermaLink="false">http://kentreis.wordpress.com/?p=13#comment-908</guid>
		<description>BTW, because Seaside is stateful, I can implement wizards by passing the model through several forms each editing a subset of the models fields and only saving the active record to disk on the final form.</description>
		<content:encoded><![CDATA[<p>BTW, because Seaside is stateful, I can implement wizards by passing the model through several forms each editing a subset of the models fields and only saving the active record to disk on the final form.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
