You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Eyal Golan <eg...@gmail.com> on 2008/07/01 14:28:41 UTC

HeaderContributer for a title

Hi,
Is there a special header contributer for <title></title> ?

-- 
Eyal Golan
egolan74@gmail.com

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

Re: HeaderContributer for a title

Posted by Martijn Dashorst <ma...@gmail.com>.
only if you define the <title wicket:id="foo"></title> in your sub pages.

Martijn

On Tue, Jul 1, 2008 at 2:36 PM, Eyal Golan <eg...@gmail.com> 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 <ma...@gmail.com>
> 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 <eg...@gmail.com> wrote:
>> > Hi,
>> > Is there a special header contributer for <title></title> ?
>> >
>> > --
>> > Eyal Golan
>> > egolan74@gmail.com
>> >
>> > 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: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Eyal Golan
> egolan74@gmail.com
>
> 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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: HeaderContributer for a title

Posted by Eyal Golan <eg...@gmail.com>.
Thanks John,
That is a great way of doing it.

On Tue, Jul 1, 2008 at 5:35 PM, John Krasnay <jo...@krasnay.ca> wrote:

> 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 <
> martijn.dashorst@gmail.com>
> > 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 <eg...@gmail.com> wrote:
> > > > Hi,
> > > > Is there a special header contributer for <title></title> ?
> > > >
> > > > --
> > > > Eyal Golan
> > > > egolan74@gmail.com
> > > >
> > > > 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: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
> >
> > --
> > Eyal Golan
> > egolan74@gmail.com
> >
> > 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Eyal Golan
egolan74@gmail.com

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

Re: HeaderContributer for a title

Posted by John Krasnay <jo...@krasnay.ca>.
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 <ma...@gmail.com>
> 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 <eg...@gmail.com> wrote:
> > > Hi,
> > > Is there a special header contributer for <title></title> ?
> > >
> > > --
> > > Eyal Golan
> > > egolan74@gmail.com
> > >
> > > 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: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> 
> -- 
> Eyal Golan
> egolan74@gmail.com
> 
> 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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: HeaderContributer for a title

Posted by Eyal Golan <eg...@gmail.com>.
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 <ma...@gmail.com>
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 <eg...@gmail.com> wrote:
> > Hi,
> > Is there a special header contributer for <title></title> ?
> >
> > --
> > Eyal Golan
> > egolan74@gmail.com
> >
> > 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Eyal Golan
egolan74@gmail.com

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

Re: HeaderContributer for a title

Posted by Martijn Dashorst <ma...@gmail.com>.
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 <eg...@gmail.com> wrote:
> Hi,
> Is there a special header contributer for <title></title> ?
>
> --
> Eyal Golan
> egolan74@gmail.com
>
> 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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org