On Aug 19, 2008, at 16:45 , Randal L. Schwartz wrote:
>>>> "Lukas" == Lukas Renggli <renggli(a)iam.unibe.ch> writes:
Lukas> One of the design goals of Magritte was, not to have blocks
Lukas> everywhere. I guess in this case that got a bit too far. It
would make
Lukas> sense to tell the decoration:
Lukas> aFormDecoration
Lukas> on: 'Done' do: [ :answer | self inform: 'done' ]
This looks great! Exactly what I had in mind.
In Magritte-Seaside.lr.273 you can write something like this (not that
I suggest that you should do it):
aModel asComponent
addValidatedForm: (Array
with: #save -> 'Yes'
with: [ :component |
component validate
ifFalse: [ component inform: 'There is a problem' ]
ifTrue: [
(component confirm: 'Save?')
ifTrue: [ component save ].
(component confirm: 'Answer?')
ifTrue: [ component answer: component
model ] ] ]
-> 'Maybe'
with: #cancel -> 'No');
yourself
I haven't tested it too much, at least it shouldn't break existing code.
There is obviously a culprit. When you use a block you have to do
everything by yourself. Validation, saving, reset, answering, etc. The
example above demonstrates pretty much everything you might want to do.
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch