You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Bart Molenkamp <b....@bizzdesign.nl> on 2007/09/04 13:36:17 UTC
Component.onBeforeRender() vs. IBehavior.beforeRender
Hi,
I found out that IBehavior.beforeRender() is called within
Component.render(), while Component.onBeforeRender() is called
before the rendering phase.
Is this correct behavior? There is a difference in this, because
a component.onBeforeRender() can change the hierarchy, while
IBehavior.beforeRender() cannot. Both names suggest that they
should be called at the same time (that is, right before or after
the Component.onBeforeRender() is called I would expect that
IBehavior.beforeRender() is called).
Thanks,
Bart.
Re: Component.onBeforeRender() vs. IBehavior.beforeRender
Posted by Matej Knopp <ma...@gmail.com>.
Hi, semantically the IBehavior.beforeRender() and Component.onBeforeRender()
are two different things.
IBehavior.beforeRender() and afterRender() are used to wrap component output
in custom markup, while Component.onBeforeRender() is place to initialize
component, build it's children, etc.
-Matej
On 9/4/07, Bart Molenkamp <b....@bizzdesign.nl> wrote:
>
> Hi,
>
> I found out that IBehavior.beforeRender() is called within
> Component.render(), while Component.onBeforeRender() is called
> before the rendering phase.
>
> Is this correct behavior? There is a difference in this, because
> a component.onBeforeRender() can change the hierarchy, while
> IBehavior.beforeRender() cannot. Both names suggest that they
> should be called at the same time (that is, right before or after
> the Component.onBeforeRender() is called I would expect that
> IBehavior.beforeRender() is called).
>
> Thanks,
> Bart.
>