> Let's say I've created a Layout and corresponding Java classes for the
> following page
> 
> ------------------
> | Header         |
> ------------------
> |      |         |
> | Menu | Content |
> |      |         |
> ------------------
> | Footer         |
> ------------------
> 
> Each section is implemented by a separate wicket Panel derived class
in
> Java. The page itself is implemented by a derivative of wicket's
WebPage
> class in the usual manner.
> 
> Now I use variations and so I can have lots of different markup for
the
> single set of classes detailed above.
> 
> I want to be able to have the flexibility to leave the header out in
> certain markup variations without wicket generating an error because
the
> page tries to add the header component.
> 
> Is there a way to create the markup so I can do this without
explicitly
> telling the Page not to load the header component?

I though of another idea of solving this problem but I am not sure if
this is possible within the wicket page/component lifecycle model:

After construction my WebPage derived class has NO components added to
it.

As the markup is processed components are added to the page on an 'as
needed' basis.

I'm not sure which method I would need to override in my page class,
perhaps onComponentTag or onComponentTagBody? I just look at the tag's
id, look up which component class that represents and then instantiate
such and add it to the WebPage class then call super.onComponentTag() or
super.onComponentTagBody().

Will there be any problems with adding components so late in the game?

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to