[Seaside] Re: Looping through all children as a performance issue
renggli at gmail.com
Thu Jan 17 22:53:35 UTC 2008
> > Normally you only return the components from #children that are
> > actually rendered. Seaside will only iterate over those, see for
> > example WASimpleNavigation for a nice implementation of a tab-panel.
> SUNavigation (and subclasses SUTabPanel, SUAccordian) currently seems to
> include all its elements in #children. Should it limit it to just the
> #selected tab or #visible accordion?
This is exactly why I wrote:
*Normally* you only return the components
from #children that are actually rendered.
In the case you add or remove components trough AJAX updates (like
this is done in SUTabPanel and SUAccordion) you need to be extremely
careful. 1,2 and 4 do never happen for such dynamically added
components, and usually this is no big deal. In the end, it all boils
down to avoid ending up with an error saying "Children not found while
processing callbacks". In any doubt (or with enough laziness) it never
hurts to answer too many children, unless you have hundreds of them.
Since Seaside does backtrack state for AJAX updates much more
precisely now, as compared to the time when SUTabPanel and SUAccordion
were written, it would probably make sense to revise this design
decision. Maybe you want to file a bug report?
More information about the seaside