wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Grigorov <mgrigo...@apache.org>
Subject Re: Panel Inheritance with TransparentWebMarkupContainer
Date Sat, 18 Aug 2012 11:12:53 GMT
Hi,

TransparentWebMarkupContainer is a container which can be used when
you don't want its children to know about it.
For example you can use it to manipulate the attributes of <html> or
<body> elements in a base page. This way the children pages can just
do "add(someOtherComponent)" instead of
"bodyComponent.add(someOtherComponent)".

On Thu, Aug 16, 2012 at 8:52 PM, brad steiner
<bsteiner@thehungersite.com> wrote:
> Can you please elaborate on the use of TransparentWebMarkupContainer in 1.5 for use with
Panel inheritance? I have a page with tabbed panels, each of which has its own left nav. Each
panel subclass thus inherits from the base class / markup where the corresponding left nav
is defined. When I attempt this using panels I receive an error indicating the <wicket:panel>
tag is not present, presumably because it's not expected within the <wicket:extend>
tag(?). I've switched my base class to inherit from TransparentWebMarkupContainer instead
of Panel but now "[Panel]" is displayed on the page with no indication my content panel markup
is being read. Obviously I would prefer not to duplicate the left nav code across all components
in a given panel. Below is my markup using the TransparentWMC approach.
>
> Thanks in advance for your help.
> Brad
>
> <!-- Base Class Panel -->
> <html xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
> <body>
>         .
>         .
>         .
>     <div class="span-30 last">
>         <br/>
>         <wicket:child/>
>     </div>
> </body>
> </html>
>
>
> <!-- Subclass Panel -->
> <wicket:extend xmlns:wicket="http://www.w3.org/1999/xhtml">
> <h2>Welcome to the Main Content Panel!</h2>
>         .
>         .
>         .
> </wicket:extend>
>
> <!-- Abstract Tab Definition -->
> final AbstractTab inboundShipmentTab = new AbstractTab(new Model<>("Inbound Shipments"))
{
>     @Override
>     public TransparentWebMarkupContainer getPanel(final String panelId) {
>         return new SubclassPanel(panelId);
>     }
> };
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Mime
View raw message