[Seaside] Updating sub-components: where?
Avi Bryant
avi.bryant at gmail.com
Sun Feb 20 01:18:41 CET 2005
On Sat, 19 Feb 2005 12:17:17 +0100, Martin J. Laubach <mjl at laubach.at> wrote:
> Is there a method that is called before a page is being built? I want
> to update the visual state of my component depending on some global
> session
> state, possibly changing/adding some subcomponents.
>
> I'm currently doing that in #children, but (a) that is called twice (I
> guess once for the redirect, once for the real page), and (b) it
> probably
> (most certainly?) is not what was intended for #children.
>
> Where to do that?
As a general piece of advice, I've found that Seaside apps work much
better when built with a pull model instead of push: for example,
determine your current subcomponents on the fly based on the state of
the world, rather than trying to keep a list constantly up to date.
Polling is almost always simpler and more robust than notifying, and
in a web application the refresh rate is low enough that there are
usually no performance concerns.
If necessary, though, we could put in an #aboutToRender hook...
Avi
More information about the Seaside
mailing list