<div dir="auto">Very nice 👏</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El dom., 16 abr. 2023 13:05, Hilaire Fernandes via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p><font size="4">Hi folks, <br>
</font></p>
<p><font size="4">Here is a first example of form declarations and
validations:</font></p>
<table width="100%" cellspacing="2" cellpadding="2" border="1">
<tbody>
<tr>
<td valign="top"><img src="cid:part1.qdxlv3bu.bL2zCdFh@free.fr" alt="form" width="403" height="247"></td>
<td valign="top">
<pre> | mold panel |
mold := Mold new.
(mold stringField)
label: 'Firstname:';
on: #propertyValue of: ValueHolder new;
beRequired.
(mold stringField)
label: 'Lastname:';
on: #propertyValue of: ValueHolder new;
addCondition: [:input| input size >= 2]
labeled: [:input | 'There is no such short name.'];
beRequired: 'Lastname required.'.
(mold dateField )
label: 'Birth date:';
on: #propertyValue of: ValueHolder new;
beRequired.
panel := nil.
panel := PluggableDialogPanel
open: mold
label: 'Example One'
view: #renderForms
accept: [mold validate.
panel morphExtent: panel minimumExtent. "I don't like to do it manually"
mold isValid ifTrue: [
mold save.
panel delete] ]</pre>
</td>
</tr>
</tbody>
</table>
<p><font size="4"><br>
</font></p>
<p>It is in the Cuis-Smalltalk-UI repo, I also added a
PluggableDialogPanel.</p>
<p>One point I don't like, not related to the forms, is after each
form validation I have to manualy resize the Panel, because
depending on error message. See my comment in the code example.<br>
</p>
Hilaire <br>
<p><br>
</p>
<pre cols="72">--
GNU Dr. Geo
<a href="http://drgeo.eu" target="_blank" rel="noreferrer">http://drgeo.eu</a>
<a href="http://blog.drgeo.eu" target="_blank" rel="noreferrer">http://blog.drgeo.eu</a></pre>
</div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div>