You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Pi Trash <pt...@web.de> on 2009/03/30 16:17:40 UTC
Extend layout of a page
Hi,
I am searching for a way to extend the design of a page without changing the page itself. That means, something like the Decorator Pattern. I have a page with for example just a table in it. In another project (or the same project) this page should have a navigation on the top.
My current solution is the following:
I have a base page which is segmented into five panels: header, left, main, right and footer. Now if a navigation is needed, a menu panel will be added to the header panel.
Is there a better way?
tia
____________________________________________________________________
Psssst! Schon vom neuen WEB.DE MultiMessenger gehört?
Der kann`s mit allen: http://www.produkte.web.de/messenger/?did=3123
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Extend layout of a page
Posted by John Patterson <jd...@gmail.com>.
ptrash wrote:
>
> Hi,
>
> can you explain a liitle bit what exactly you mean?
>
>
>
> nino martinez wael wrote:
>>
>> you could do something like composition by doing inheritance and
>> repeaters...
>>
>
>
For your composite pages to know where to put their components in the flow
of the page you either need to define a new html template which means
subclassing, or use a RepeatingView as suggested to simply add the panels
one after the other.
You can create a baseclass with protected methods used to create components
to place into a template. Then your subclass could override those methods
to supply whatever components you want. The baseclass could choose to place
invisible place holders if your subclass does not want to supply a
component.
One gotcha is that if your subclasses need to reference instance variables
to create their panels (very likely) then you _cannot_ call the overriden
methods from the baseclass constructor... because the sublass instance
variables will not have been initialised. Instead you need to build your
baseclass component hierarchy in onBeforeRender() and make sure to only
build the page once.
See this thread for details:
http://www.nabble.com/Alternative-method-to-initialise-page-td16742636.html
John
--
View this message in context: http://www.nabble.com/Extend-layout-of-a-page-tp22784265p23004651.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Extend layout of a page
Posted by ptrash <pt...@web.de>.
Hi,
can you explain a liitle bit what exactly you mean?
nino martinez wael wrote:
>
> you could do something like composition by doing inheritance and
> repeaters...
>
--
View this message in context: http://www.nabble.com/Extend-layout-of-a-page-tp22784265p22902907.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Extend layout of a page
Posted by nino martinez wael <ni...@gmail.com>.
you could do something like composition by doing inheritance and repeaters...
2009/3/31 ptrash <pt...@web.de>:
>
> At the moment, the requirements are not certained. That's why it should be
> possible to extend the page without modifying it. I'd like to use something
> like composition.
> --
> View this message in context: http://www.nabble.com/Extend-layout-of-a-page-tp22784265p22800066.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Extend layout of a page
Posted by ptrash <pt...@web.de>.
At the moment, the requirements are not certained. That's why it should be
possible to extend the page without modifying it. I'd like to use something
like composition.
--
View this message in context: http://www.nabble.com/Extend-layout-of-a-page-tp22784265p22800066.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Extend layout of a page
Posted by Jeremy Thomerson <je...@wickettraining.com>.
Just use regular OO design. Maybe you could add them both in your parent
class, based on a boolean condition that is an abstract method. Then your
child classes only have to override includePageClock() method, for example.
--
Jeremy Thomerson
http://www.wickettraining.com
On Tue, Mar 31, 2009 at 2:10 AM, ptrash <pt...@web.de> wrote:
>
>
> Serkan Camurcuoglu-3 wrote:
> >
> > search for the words "wicket markup inheritance" on google..
> >
>
>
> Hi,
>
> isn't there another way besides using inheritance? If e.g. I extend my page
> two times: add a menu bar to it (pageMenu) and add a clock to it
> (pageClock). Now I need a page which has both, clock and menu
> (pageMenuAndClock). I can just extend pageMenu or pageClock. So the
> functionality of one of them has to be rewritten in pageMenuAndClock.
> --
> View this message in context:
> http://www.nabble.com/Extend-layout-of-a-page-tp22784265p22799536.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Extend layout of a page
Posted by ptrash <pt...@web.de>.
Serkan Camurcuoglu-3 wrote:
>
> search for the words "wicket markup inheritance" on google..
>
Hi,
isn't there another way besides using inheritance? If e.g. I extend my page
two times: add a menu bar to it (pageMenu) and add a clock to it
(pageClock). Now I need a page which has both, clock and menu
(pageMenuAndClock). I can just extend pageMenu or pageClock. So the
functionality of one of them has to be rewritten in pageMenuAndClock.
--
View this message in context: http://www.nabble.com/Extend-layout-of-a-page-tp22784265p22799536.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Extend layout of a page
Posted by Serkan Camurcuoglu <Se...@telenity.com>.
search for the words "wicket markup inheritance" on google..
Pi Trash wrote:
> Hi,
>
> I am searching for a way to extend the design of a page without changing the page itself. That means, something like the Decorator Pattern. I have a page with for example just a table in it. In another project (or the same project) this page should have a navigation on the top.
>
> My current solution is the following:
> I have a base page which is segmented into five panels: header, left, main, right and footer. Now if a navigation is needed, a menu panel will be added to the header panel.
>
> Is there a better way?
>
> tia
> ____________________________________________________________________
> Psssst! Schon vom neuen WEB.DE MultiMessenger gehört?
> Der kann`s mit allen: http://www.produkte.web.de/messenger/?did=3123
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org