On Thu, Feb 17, 2011 at 9:34 PM, fachhoch <[email protected]> wrote:

>
> I need a    component which I want to show in all my pages , this component
> takes time for loading so
> I don't want to contruct this   everytime but create it once  when user
> logs
> in put in his  session and show the same component in all my pages  and
> also
> this componenet should update itself at frequent intervals  in a seperate
> thread   .Please advice me , and are there any examples  ?
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/a-common-component-for-all-my-pages-which-takes-lot-of-time-to-load-tp3311989p3311989.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Don't share components across pages.  It will cause problems.  Most likely,
it is not your component that actually takes a long time to load - it's
probably the data.  You may be loading it in the constructor, but you
shouldn't be.  You should be loading it in a model
(LoadableDetachableModel).  And, you should load it from a service that does
this caching / refreshing for you.  It shouldn't be managed by your UI.

I could be off - but that answer is right 99% of the time for these
questions.  If I'm off, send more details, preferably including code.

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

Reply via email to