[Seaside] [ENH] HandyComponent

Sebastián Sastre ssastre at seaswork.com.ar
Fri Mar 26 04:07:40 CET 2004


> 
> On Mar 24, 2004, at 9:04 AM, miso.list at auf.net wrote:
> 
> > Adds a few simple and handy utilities to your components:
> >
> > * a 'finite state machine': Seaside components are mostly 
> restricted 
> > to rendering one page (#renderContentsOn:). This is often 
> suboptimal 
> > design-wise, where one component (eg. PersonEditor) would 
> ideally have 
> > all responsability for its area (eg. #displayPerson, #editPerson, 
> > #changePassword, etc.). HandyComponent allows you to do that by 
> > specifying what 'state' the component is in via e.g. 'self state: 
> > #editPerson'. On the next rendering cycle, this will automatically 
> > call the #editPerson method in your component (see 
> #renderContentOn:). 
> > A link to 'edit' the person would thus be:
> >   self anchorWithAction: [self state: #editPerson] text: 
> 'edit'. The 
> > nil state triggers #proposeMainMenu, which does nothing by default 
> > This is the primary place that your subclass should override to fit 
> > your needs.
> 
> Can you give me a complete example of where you would use this?  It 
> seems like the sort of thing that I would do with several components 
> and a Task, and it would be interesting to compare the two 
> implementation strategies.  Offhand, I don't see a great advantage to 
> having multiple views provided by one class, but I'm open to being 
> convinced.

	Hi Avi, I think it could be useful if you want to make an
intranet for users with different priviledges. I wonder how you can make
that feature without an idea like the one that Michal give to us. I
would like to know

Regards

Seb






More information about the Seaside mailing list