[Seaside] dynamically chosen subcomponents

Avi Bryant avi@beta4.com
Tue, 4 Jun 2002 11:10:45 -0700 (PDT)


On Tue, 4 Jun 2002, Tim Rowledge wrote:

> My initial idea for handling this is to have various classes of
> subcomponent that copes with each type of question. How can I make
> seaside deal with this neatly?

Neatly? You can't.  This is currently one of the major annoyances I have
with Seaside, although I do plan to fix it soon (the need for (locals
at: #each) in your last message is only a minor annoyance ;-).

The inspector has to do the same thing, because eg. Dictionary uses a
different inspector class.  You can see its ugly solution in
IAInspectorFrame>>object: - whenever the object (question) changes,
explicitly modify the children cache to have the right class of
subcomponent.

The hard part about fixing this is that Seaside can't really know, unless
you explicitly tell it, when it should dump the current subcomponent and
create a new one (possibly of a different class).  It can't do this every
time, because the subcomponent might have useful state, including possibly
being off on some callPage: thread.  But if it doesn't ever replace the
cached subcomponent (as now), then you can't change its class.  There
are some reasonable points in between, but I haven't implemented any of
them yet.

Avi