[Seaside] Changing WAFormDecoration to use a callback instead of
passing in a list of symbols (for buttons)
Yar Hwee Boon
hboon at motionobj.com
Thu Feb 17 03:58:58 CET 2005
On 17-Feb-05, at AM 04:08, Avi Bryant wrote:
> - should it be a callback selector or a block? I tend towards using
> the latter more than the former, although there are advantages to
> each.
As you mentioned below, an obvious place where this is useful is where
the change is to be dynamic. If you pass in a block, you can do it as
1. [#(#save #cancel)]
2. [self buttons]
With (1), it is still not dynamic, defeating the purpose. You don't
have a place to edit it before reloading the page when developing. With
(2), you end up with a selector, still. Do you see any advantage to a
block over a callback selector in this situation?
> otherwise. What's the use case where you ran into this, exactly?
I have a set of dialogs for editing questions (ie. those in exam
papers), as in multiple choice, fill in the blanks, etc. In "create"
mode, I would like the dialog to have the buttons #save, #cancel,
#saveAndCreateAnother, while in edit mode, only #save, #cancel.
Currently, if I want to change the buttons, I need to override #buttons
which will in turn be sent in WAFormDialog>>addForm. But this is done
as part of #initialize, that means I can't do the following:
=======
self call: aQuestion dialogOnSelf disableSaveAndCreateAnother
=======
By the time the dialog is created, the buttons have already been set.
What I would like to do is to set a flag in
#disableSaveAndCreateAnother so that I can decide to not render
#saveAndCreateAnother at the point of rendering, or at least
post-initialization.
--
HweeBoon
MotionObj
(65) 6764-9774
More information about the Seaside
mailing list