[Seaside] Widget implementation question

Avi Bryant avi at beta4.com
Tue Apr 8 14:29:59 CEST 2003


On Tue, 8 Apr 2003, Derek Brans wrote:

> In my ValueView subclass I had rendering code like this:
>
> renderOn: html
>     renderDayChooserThatSetsMyDayState
>     renderMonthChooserThatSetsMyMonthState
>     renderYearChooserThatSetsMyYearState
>
>     html renderHiddenInputWithValue: 'ignore' callback: [:ignore | self turnMyStateIntoADateObjectAndPassItToMyModel]
>
> Anyone handled the same problem before?

Hey, neat.
The way I've handled that exact problem (DateSelector) is by using pull
instead of push; that is, the user of the date selector sends it #date
rather than the date selector pushing a date back.  I had it as a
Component not as a View, but that's pretty much necessary anyway so you
can do validation (you need state so that you can remember the invalid
date and redisplay it, without actually storing it in your model).

I'll try to find that DateSelector and include it in the release, it's a
useful example anyway.

But your use of the hidden input is also a nice solution (if combined with
some other validation policy), and yes, I would think it could be
generalized.  I'll think about that.

(Note to Colin - this is why we need a well defined evaluation order for
the callbacks...)

Avi



More information about the Seaside mailing list