You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by ptrash <pt...@web.de> on 2009/04/06 08:25:56 UTC

Re: Extend layout of a page

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 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