You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sebastien <se...@gmail.com> on 2013/08/10 20:30:04 UTC
Behavior#beforeRender() & Behavior#renderHead()
Dear all,
Quick question: is this the intended behavior that Behavior#renderHead() is
triggered *before* Behavior#beforeRender()?
If yes, what could be the best way to have a #beforeRenderHead method?
Thanks in advance,
Sebastien.
Re: Behavior#beforeRender() & Behavior#renderHead()
Posted by Sebastien <se...@gmail.com>.
Hi Sven,
Thanks very much for your answer. Actually in my #onConfigure (A), I add a
Behavior that overrides #onConfigure(Component) (B) which calls
super.onConfigure(Component) (C), which calls component#onConfigure(this)
(D) (custom method where 'this' is the behavior). What is updated in D is
designed to be used in Behavior#renderHead...
So, if I do component.setVisible(false) in B, I do not have the correct
value in D, because of the order of calls of super(s). So, the workaround
is to call super at the end of B, but if I had a #beforeRenderHead method,
it would have been simpler and safer...
Thanks & best regards,
Sebastien
On Sat, Aug 10, 2013 at 8:43 PM, Sven Meier <sv...@meiers.net> wrote:
> Behavior#renderHead() is triggered *before* Behavior#beforeRender()?
>>
>
> Yes, this is correct. Note that Behavior#beforeRender() is called
> immediately before rendering, while Component#onBeforeRender() is called in
> a separate traversal of the component tree *before* all components are
> rendered.
>
>
> If yes, what could be the best way to have a #beforeRenderHead method?
>>
>
> What do you need it for? Try #onConfigure().
>
> Sven
>
>
>
>
> On 08/10/2013 08:30 PM, Sebastien wrote:
>
>> Dear all,
>>
>> Quick question: is this the intended behavior that Behavior#renderHead()
>> is
>> triggered *before* Behavior#beforeRender()?
>>
>> If yes, what could be the best way to have a #beforeRenderHead method?
>>
>> Thanks in advance,
>> Sebastien.
>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Behavior#beforeRender() & Behavior#renderHead()
Posted by Sven Meier <sv...@meiers.net>.
>Behavior#renderHead() is triggered *before* Behavior#beforeRender()?
Yes, this is correct. Note that Behavior#beforeRender() is called immediately before rendering, while Component#onBeforeRender() is called in a separate traversal of the component tree *before* all components are rendered.
>If yes, what could be the best way to have a #beforeRenderHead method?
What do you need it for? Try #onConfigure().
Sven
On 08/10/2013 08:30 PM, Sebastien wrote:
> Dear all,
>
> Quick question: is this the intended behavior that Behavior#renderHead() is
> triggered *before* Behavior#beforeRender()?
>
> If yes, what could be the best way to have a #beforeRenderHead method?
>
> Thanks in advance,
> Sebastien.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org