You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Eyal Golan <eg...@gmail.com> on 2008/11/17 13:50:50 UTC

Session / Application : where to put a component

Our application has a base page and we use markup inheritance.
In the base page we have a headerWe call it HeaderPanel.
HeaderPanel has MainTabsPanel, which consists with the menu links.

The situation now is that for each page, the HeaderPanel and MainTabsPanel
are constructed in each page (because of the markup inheritance).
This is what we have in the base page constructor:
HeaderPanel headerPanel = new HeaderPanel("headerPanel", this);
And this is in the HeaderPanel constructor:
add(new MainTabsPanel("mainTabs"));

For some reasons I want the MainTabsPanel to be constructed only once.

So, instead of adding using new, I want something like:
add(mySession.getMainTabsPanel());
or
add(myApplication.getMainTabsPanel());

Which one is better or is there even something better than this?



Eyal Golan
egolan74@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary

Re: Session / Application : where to put a component

Posted by Eyal Golan <eg...@gmail.com>.
OK.
Thanks,
I'll see if I can do it differently.


Eyal Golan
egolan74@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


On Mon, Nov 17, 2008 at 3:31 PM, Martijn Dashorst <
martijn.dashorst@gmail.com> wrote:

> Don't share components across requests or even pages. You can't do that.
>
> Martijn
>
> On Mon, Nov 17, 2008 at 1:50 PM, Eyal Golan <eg...@gmail.com> wrote:
> > Our application has a base page and we use markup inheritance.
> > In the base page we have a headerWe call it HeaderPanel.
> > HeaderPanel has MainTabsPanel, which consists with the menu links.
> >
> > The situation now is that for each page, the HeaderPanel and
> MainTabsPanel
> > are constructed in each page (because of the markup inheritance).
> > This is what we have in the base page constructor:
> > HeaderPanel headerPanel = new HeaderPanel("headerPanel", this);
> > And this is in the HeaderPanel constructor:
> > add(new MainTabsPanel("mainTabs"));
> >
> > For some reasons I want the MainTabsPanel to be constructed only once.
> >
> > So, instead of adding using new, I want something like:
> > add(mySession.getMainTabsPanel());
> > or
> > add(myApplication.getMainTabsPanel());
> >
> > Which one is better or is there even something better than this?
> >
> >
> >
> > Eyal Golan
> > egolan74@gmail.com
> >
> > Visit: http://jvdrums.sourceforge.net/
> > LinkedIn: http://www.linkedin.com/in/egolan74
> >
> > P  Save a tree. Please don't print this e-mail unless it's really
> necessary
> >
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.3.4 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Session / Application : where to put a component

Posted by Martijn Dashorst <ma...@gmail.com>.
Don't share components across requests or even pages. You can't do that.

Martijn

On Mon, Nov 17, 2008 at 1:50 PM, Eyal Golan <eg...@gmail.com> wrote:
> Our application has a base page and we use markup inheritance.
> In the base page we have a headerWe call it HeaderPanel.
> HeaderPanel has MainTabsPanel, which consists with the menu links.
>
> The situation now is that for each page, the HeaderPanel and MainTabsPanel
> are constructed in each page (because of the markup inheritance).
> This is what we have in the base page constructor:
> HeaderPanel headerPanel = new HeaderPanel("headerPanel", this);
> And this is in the HeaderPanel constructor:
> add(new MainTabsPanel("mainTabs"));
>
> For some reasons I want the MainTabsPanel to be constructed only once.
>
> So, instead of adding using new, I want something like:
> add(mySession.getMainTabsPanel());
> or
> add(myApplication.getMainTabsPanel());
>
> Which one is better or is there even something better than this?
>
>
>
> Eyal Golan
> egolan74@gmail.com
>
> Visit: http://jvdrums.sourceforge.net/
> LinkedIn: http://www.linkedin.com/in/egolan74
>
> P  Save a tree. Please don't print this e-mail unless it's really necessary
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org