-----Original Message----- From: Jeremy Thomerson [mailto:[email protected]] Sent: Tuesday, June 15, 2010 11:26 AM To: [email protected] Cc: Berlin Brown Subject: Re: Question about markup inheritance and page layouts
On Tue, Jun 15, 2010 at 10:07 AM, Brown, Berlin [GCG-PFS] < [email protected]> wrote: > I was a little confused about page layouts and markup inheritance. I > was thinking that a I could take a piece of HTML markup and reuse that > component when I need to, and use it multiple times within page > without ever having to create the content. > > I was not able to do this. What I have now, it seems I can only use > parent child inheritance with one sub-component. > > Pseudo Code .... > > BasePage.java: > > public abstract class BasePage extends WebPage { > > public BasePage(final PageParameters parameters) { > } > } > > BasePage.html: > > <html> > <wicket:child /> > </html> > > ---- > > SomePage.java > > public class SomePage extends BasePage { > > public SomePage(final PageParameters parameters) { > } > } > > SomePage.html: > <wicket:extend> > <div> > <div wicket:id="myPanel"></div> > <div wicket:id="myPanel1"></div> > </div> > </wicket:extend> > > ---- > > BasePanel.java > ... > > BasePanel.html > <div> > <wicket:child /> > </div> > > MyPanel1.java extends BasePanel > ... > > MyPane1l.html > <wicket:extend> > <div> > </div> > </wicket:extend> > > ---- > > Basically: > > BasePage has child page -> Some Page ... Some Page has child panels > BasePanel -> My Panel and My Panel1 ... > > I don't get the output I would expect. It looks like the markup > inheritance stops at "SomePage" and doesn't recognize the "BasePanel" > HTML child code. > > My intended goal is to avoid duplicating HTML content, what is the > best way to achieve that. Maybe I should use markup inheritance for > the panel instead of the page? > > > Where did you place the wicket:panel tags in your markup? -- Jeremy Thomerson http://www.wickettraining.com They are in the SomePage: > SomePage.html: > <wicket:extend> > <div> > <div wicket:id="myPanel"></div> > <div wicket:id="myPanel1"></div> > </div> > </wicket:extend> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
