I like to do this in my base page:

<title wicket:id="title">foo</title>

protected IModel getPageTitleModel() {
    return new ResourceModel(getClass().getSimpleName());
}

add(new Label("title, new AbstractReadOnlyModel() {
    public Object getObject() {
        return getPageTitleModel().getObject();
    }
}));

The AbstractReadOnlyModel is there to ensure I'm not calling the
overrideable getPageTitleModel() from my base class constructor.

By default my page titles come from my application's .properties file,
like this:

UserPage=User
ClientPage=Client

I re-use these labels when creating links to the same page. Of course, I
can override getPageTitleModel() to return a custom title when needed.

jk

On Tue, Jul 01, 2008 at 03:36:45PM +0300, Eyal Golan wrote:
> yeah, but what if I have a markup inheritance?
> I then must use <wicket:head> ... don't I ?
> 
> On Tue, Jul 1, 2008 at 3:34 PM, Martijn Dashorst <[EMAIL PROTECTED]>
> wrote:
> 
> > nope. just use:
> >
> > <title wicket:id="title"></title>
> >
> > add(new Label("title", "Hello, World!"));
> >
> > On Tue, Jul 1, 2008 at 2:28 PM, Eyal Golan <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > > Is there a special header contributer for <title></title> ?
> > >
> > > --
> > > Eyal Golan
> > > [EMAIL PROTECTED]
> > >
> > > Visit: http://jvdrums.sourceforge.net/
> > > LinkedIn: http://www.linkedin.com/in/egolan74
> > >
> > > P Save a tree. Please don't print this e-mail unless it's really
> > necessary
> > >
> >
> >
> >
> > --
> > Become a Wicket expert, learn from the best: http://wicketinaction.com
> > Apache Wicket 1.3.4 is released
> > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> -- 
> Eyal Golan
> [EMAIL PROTECTED]
> 
> Visit: http://jvdrums.sourceforge.net/
> LinkedIn: http://www.linkedin.com/in/egolan74
> 
> P Save a tree. Please don't print this e-mail unless it's really necessary

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to