[Seaside] Changing WAFormDecoration to use a callback instead of passing in a list of symbols (for buttons)

Avi Bryant avi.bryant at gmail.com
Wed Feb 16 21:08:54 CET 2005


On Mon, 7 Feb 2005 21:43:21 +0800, Yar Hwee Boon <hboon at motionobj.com> wrote:
> I have a dialog class that indirectly inherits from WAFormDialog.
> Depending in where this dialog is used, I would like it to have
> different buttons, eg. #save, #saveAndCreateAnother, #cancel instead of
> #save and #cancel. Looking at how WAFormDecoration is used right now
> (in the Seaside base, its only used in WAFormDialog), would it be more
> flexible and not more complicated to change how buttons are specified
> from passing in a list of symbols to using a callback, so that we have:
> 
> WAFormDialog>>addForm
>         form := WAFormDecoration new buttonsCallbackSymbol: #buttons.  "or
> just WAFormDecoration new"
>         self addDecoration: form

This sounds fine, though a couple of questions:

- 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.
- this seems most useful when the list of buttons is changing
dynamically; I've noticed a desire for that when developing (I'd
rather reload than have to recreate the current page), but not so much
otherwise.  What's the use case where you ran into this, exactly?

Avi


More information about the Seaside mailing list