Also take a look over the user guide's section on inheritance:
http://wicket.apache.org/guide/guide/layout.html#layout_2

~ Thank you,
   Paul Bors


On Fri, Feb 14, 2014 at 3:42 PM, Richter, Marvin <
marvin.rich...@jestadigital.com> wrote:

> That is definitely not a good way to do inheritance. This way you force
> everyone who extends from MyBasePage to know that he has to have a tag in
> his markup file with a wicket:id he might not know.
>
> The right way would be to have a markup file for MyBasePage.java and
> include the <wicket:extend> tag.
>
> MyBasePage.html
> <html>
> <body>
>         <span wicket:id="panel"/>
>         <wicket:extend></wicket:extend>
> </body>
> </html>
>
> This way every page which extends MyBasePage.java inherits the panel and
> the components you add in the subclasses will be placed in the place where
> you defined <wicket:extend>
>
> Best,
> Marvin
>
> Am 14.02.2014 um 20:04 schrieb Farrukh SATTOROV <fireda...@gmail.com>:
>
> > my code work, if by definition each WebPage and Panel must have own
> markup
> > ?
> >
> > MyBasePage.java:
> > public class MyBasePage extends WebPage {
> >
> > public MyBasePage() {
> > add(new MyPanel("panel"));
> > }
> > }
> >
> > no MyBasePage.html, i remove it.
> >
> > SubPage.java:
> > public class SubPage extends MyBasePage {
> > public SubPage() {
> > }
> >
> > }
> >
> > SubPage.html:
> > <html>
> > <body>
> > <span wicket:id="panel"/>
> > </body>
> > </html>
> >
> > MyPanel.html
> > <body>
> > <wicket:panel>
> > <span>MyPanel</span>
> > </wicket:panel>
> > </body>
> >
> >
> > On Fri, Feb 14, 2014 at 10:56 PM, Sven Meier <s...@meiers.net> wrote:
> >
> >> With a wicket:id declared in Html markup, a corresponding component with
> >> the same id has to present as child.
> >>
> >> It doesn't matter when the child component is added: in the constructor
> or
> >> one of its super constructors (or even later).
> >> This does not have anything to do with markup inheritance.
> >>
> >> Hope this helps
> >> Sven
> >>
> >>
> >> On 02/14/2014 07:34 PM, Farrukh SATTOROV wrote:
> >>
> >>> Hi everyone. I confused when i look to standard wicket heloworld
> example
> >>> and try understanding  snippet of <span wicket:id="mainNavigation"/>.
> How
> >>> HelloWorld.html works without <extend></extend> while id mainNavigation
> >>> located in superclass (WicketExamplePage). Explain to me mechanism of
> >>> looking for wicket:id in this case.
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > С уважением и наилучшими пожеланиями
> > *Фаррух*
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to