You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by zhdanov <te...@mail.ru> on 2007/03/22 12:29:34 UTC

Component render listener

Hi, guys.

In wicket spring application spring beans are injected on component
instantiation. That is not good at all if some bean is huge enough, so it
may be serialized/deserialized dozens of times. Is there any way to inject
bean directly before component is prepaired for rendering? So, how do I get
notified when wicket component begins to render?
-- 
View this message in context: http://www.nabble.com/Component-render-listener-tf3446628.html#a9611797
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: Component render listener

Posted by Igor Vaynberg <ig...@gmail.com>.
or use aop and weave it in. i do not think we want to build support for this
into the framework.

-igor


On 3/23/07, Eelco Hillenius <ee...@gmail.com> wrote:
>
> > I meant some kind of listener, but not modifying each component's
> onAttach()
> > and onBeforeRender().
> > Is there any way to do this, except through authorization strategies?
>
> We don't have a mechanism for that (except, like you said, auth
> strats, though they are obviously meant for a different use), but what
> you can do is create subclasses of the components you need (you'll end
> up with quite a bunch of classes, but it's not that much work) and
> implement such a mechanism yourselve by overriding the appropriate
> methods.
>
> Eelco
>

Re: Component render listener

Posted by Eelco Hillenius <ee...@gmail.com>.
> I meant some kind of listener, but not modifying each component's onAttach()
> and onBeforeRender().
> Is there any way to do this, except through authorization strategies?

We don't have a mechanism for that (except, like you said, auth
strats, though they are obviously meant for a different use), but what
you can do is create subclasses of the components you need (you'll end
up with quite a bunch of classes, but it's not that much work) and
implement such a mechanism yourselve by overriding the appropriate
methods.

Eelco

Re: Component render listener

Posted by zhdanov <te...@mail.ru>.
I'm afraid that you have not understand me correctly.

Please, look the previuos messages through. 
I meant some kind of listener, but not modifying each component's onAttach()
and onBeforeRender(). 
Is there any way to do this, except through authorization strategies?

-yakov



igor.vaynberg wrote:
> 
> see component.onattach() and component.beforerender()
> 
> -igor
> 
> 
> On 3/22/07, zhdanov <te...@mail.ru> wrote:
>>
>>
>> Thanks,
>> Sorry, I've didnot notice that before. Now I see. It's ok.
>>
>> But all the same, is there a common mechanism to get notification when
>> components begin to render? (same as IComponentInstantiationListener)
>>
>>
>> Matej Knopp-2 wrote:
>> >
>> > do you using wicket-spring ?
>> > Because if so than the beans are not serialized with the component.
>> > Only a very small proxy that knows how to locate the bean.
>> >
>> > -Matej
>> >
>> > On 3/22/07, zhdanov <te...@mail.ru> wrote:
>> >>
>> >> Hi, guys.
>> >>
>> >> In wicket spring application spring beans are injected on component
>> >> instantiation. That is not good at all if some bean is huge enough, so
>> it
>> >> may be serialized/deserialized dozens of times. Is there any way to
>> >> inject
>> >> bean directly before component is prepaired for rendering? So, how do
>> I
>> >> get
>> >> notified when wicket component begins to render?
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Component-render-listener-tf3446628.html#a9611797
>> >> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Component-render-listener-tf3446628.html#a9629076
>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Component-render-listener-tf3446628.html#a9630369
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: Component render listener

Posted by Igor Vaynberg <ig...@gmail.com>.
see component.onattach() and component.beforerender()

-igor


On 3/22/07, zhdanov <te...@mail.ru> wrote:
>
>
> Thanks,
> Sorry, I've didnot notice that before. Now I see. It's ok.
>
> But all the same, is there a common mechanism to get notification when
> components begin to render? (same as IComponentInstantiationListener)
>
>
> Matej Knopp-2 wrote:
> >
> > do you using wicket-spring ?
> > Because if so than the beans are not serialized with the component.
> > Only a very small proxy that knows how to locate the bean.
> >
> > -Matej
> >
> > On 3/22/07, zhdanov <te...@mail.ru> wrote:
> >>
> >> Hi, guys.
> >>
> >> In wicket spring application spring beans are injected on component
> >> instantiation. That is not good at all if some bean is huge enough, so
> it
> >> may be serialized/deserialized dozens of times. Is there any way to
> >> inject
> >> bean directly before component is prepaired for rendering? So, how do I
> >> get
> >> notified when wicket component begins to render?
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Component-render-listener-tf3446628.html#a9611797
> >> Sent from the Wicket - Dev mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Component-render-listener-tf3446628.html#a9629076
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>

Re: Component render listener

Posted by zhdanov <te...@mail.ru>.
Thanks, 
Sorry, I've didnot notice that before. Now I see. It's ok.

But all the same, is there a common mechanism to get notification when
components begin to render? (same as IComponentInstantiationListener)


Matej Knopp-2 wrote:
> 
> do you using wicket-spring ?
> Because if so than the beans are not serialized with the component.
> Only a very small proxy that knows how to locate the bean.
> 
> -Matej
> 
> On 3/22/07, zhdanov <te...@mail.ru> wrote:
>>
>> Hi, guys.
>>
>> In wicket spring application spring beans are injected on component
>> instantiation. That is not good at all if some bean is huge enough, so it
>> may be serialized/deserialized dozens of times. Is there any way to
>> inject
>> bean directly before component is prepaired for rendering? So, how do I
>> get
>> notified when wicket component begins to render?
>> --
>> View this message in context:
>> http://www.nabble.com/Component-render-listener-tf3446628.html#a9611797
>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Component-render-listener-tf3446628.html#a9629076
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: Component render listener

Posted by Matej Knopp <ma...@gmail.com>.
do you using wicket-spring ?
Because if so than the beans are not serialized with the component.
Only a very small proxy that knows how to locate the bean.

-Matej

On 3/22/07, zhdanov <te...@mail.ru> wrote:
>
> Hi, guys.
>
> In wicket spring application spring beans are injected on component
> instantiation. That is not good at all if some bean is huge enough, so it
> may be serialized/deserialized dozens of times. Is there any way to inject
> bean directly before component is prepaired for rendering? So, how do I get
> notified when wicket component begins to render?
> --
> View this message in context: http://www.nabble.com/Component-render-listener-tf3446628.html#a9611797
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>