You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by ganea iulia <su...@gmail.com> on 2016/11/01 08:02:47 UTC
How to access wicket parent page wicket:message
<wicket:message key="pageTitle">[pageTitle]</wicket:message>
Hi,
I'm using wicket 7.5.
I have a parent page, and child pages that extend it: <wicket:extend>
In my child .properties pages, I always had the pageTitle=My Titile.
I now need to dinamically change the title of the page, inside my child
page constructor.
Could you please advise?
Thank you
Re: How to access wicket parent page wicket:message
Posted by Martin Grigorov <mg...@apache.org>.
On Tue, Nov 1, 2016 at 10:06 AM, ganea iulia <su...@gmail.com> wrote:
> Hello again,
>
> So I need to change the parent page markup?
>
Yes.
> I was thinking if there was a way to not change anything in the parent
> page...
>
> So my parent page html contains this markup:
> <wicket:message key="pageTitle">[pageTitle]</wicket:message>
>
> I need in my child pages, to be able to dinamically change the title.
> Until
> now, every child page had a pageTitle property in the .properties file
> and that was setting the title.
>
> But now, I have a situation where I need to open up the same child page
> with different titles, based on some condition.
>
>
> Thank you
>
>
> On Tue, Nov 1, 2016 at 10:57 AM, Martin Grigorov <mg...@apache.org>
> wrote:
>
> > I'd expect Wicket to complain (i.e. throw an exception) that you have
> added
> > a component in the Java code but there is no element for it in the HTML.
> > You need to remove <wicket:message> and add wicket:id="pageTitle" on the
> > <title> element.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Tue, Nov 1, 2016 at 9:39 AM, ganea iulia <su...@gmail.com>
> > wrote:
> >
> > > Hello,
> > >
> > > Could you please provide an example?
> > >
> > > I have added the below line in my constructor, but nothing appears
> where
> > > the title should be.
> > >
> > > add(new Label("pageTitle", new ResourceModel("pageTitle", "my
> title")));
> > >
> > > In the child .properties files I have left the pageTitle empty:
> > pageTitle=
> > >
> > > In the child .html page, I haven't added anything.
> > >
> > >
> > > Thank you.
> > >
> > >
> > >
> > >
> > >
> > >
> > > On Tue, Nov 1, 2016 at 10:14 AM, Martin Grigorov <mgrigorov@apache.org
> >
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > You will need to use a Label component with ResourceModel instead of
> > > > <wicket:message>.
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > > > On Tue, Nov 1, 2016 at 9:02 AM, ganea iulia <su...@gmail.com>
> > > > wrote:
> > > >
> > > > > <wicket:message key="pageTitle">[pageTitle]</wicket:message>
> > > > >
> > > > > Hi,
> > > > > I'm using wicket 7.5.
> > > > >
> > > > > I have a parent page, and child pages that extend it:
> <wicket:extend>
> > > > >
> > > > > In my child .properties pages, I always had the pageTitle=My
> Titile.
> > > > >
> > > > > I now need to dinamically change the title of the page, inside my
> > child
> > > > > page constructor.
> > > > >
> > > > > Could you please advise?
> > > > >
> > > > > Thank you
> > > > >
> > > >
> > >
> >
>
Re: How to access wicket parent page wicket:message
Posted by ganea iulia <su...@gmail.com>.
Hello again,
So I need to change the parent page markup?
I was thinking if there was a way to not change anything in the parent
page...
So my parent page html contains this markup:
<wicket:message key="pageTitle">[pageTitle]</wicket:message>
I need in my child pages, to be able to dinamically change the title. Until
now, every child page had a pageTitle property in the .properties file
and that was setting the title.
But now, I have a situation where I need to open up the same child page
with different titles, based on some condition.
Thank you
On Tue, Nov 1, 2016 at 10:57 AM, Martin Grigorov <mg...@apache.org>
wrote:
> I'd expect Wicket to complain (i.e. throw an exception) that you have added
> a component in the Java code but there is no element for it in the HTML.
> You need to remove <wicket:message> and add wicket:id="pageTitle" on the
> <title> element.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Nov 1, 2016 at 9:39 AM, ganea iulia <su...@gmail.com>
> wrote:
>
> > Hello,
> >
> > Could you please provide an example?
> >
> > I have added the below line in my constructor, but nothing appears where
> > the title should be.
> >
> > add(new Label("pageTitle", new ResourceModel("pageTitle", "my title")));
> >
> > In the child .properties files I have left the pageTitle empty:
> pageTitle=
> >
> > In the child .html page, I haven't added anything.
> >
> >
> > Thank you.
> >
> >
> >
> >
> >
> >
> > On Tue, Nov 1, 2016 at 10:14 AM, Martin Grigorov <mg...@apache.org>
> > wrote:
> >
> > > Hi,
> > >
> > > You will need to use a Label component with ResourceModel instead of
> > > <wicket:message>.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Tue, Nov 1, 2016 at 9:02 AM, ganea iulia <su...@gmail.com>
> > > wrote:
> > >
> > > > <wicket:message key="pageTitle">[pageTitle]</wicket:message>
> > > >
> > > > Hi,
> > > > I'm using wicket 7.5.
> > > >
> > > > I have a parent page, and child pages that extend it: <wicket:extend>
> > > >
> > > > In my child .properties pages, I always had the pageTitle=My Titile.
> > > >
> > > > I now need to dinamically change the title of the page, inside my
> child
> > > > page constructor.
> > > >
> > > > Could you please advise?
> > > >
> > > > Thank you
> > > >
> > >
> >
>
Re: How to access wicket parent page wicket:message
Posted by Martin Grigorov <mg...@apache.org>.
I'd expect Wicket to complain (i.e. throw an exception) that you have added
a component in the Java code but there is no element for it in the HTML.
You need to remove <wicket:message> and add wicket:id="pageTitle" on the
<title> element.
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Tue, Nov 1, 2016 at 9:39 AM, ganea iulia <su...@gmail.com> wrote:
> Hello,
>
> Could you please provide an example?
>
> I have added the below line in my constructor, but nothing appears where
> the title should be.
>
> add(new Label("pageTitle", new ResourceModel("pageTitle", "my title")));
>
> In the child .properties files I have left the pageTitle empty: pageTitle=
>
> In the child .html page, I haven't added anything.
>
>
> Thank you.
>
>
>
>
>
>
> On Tue, Nov 1, 2016 at 10:14 AM, Martin Grigorov <mg...@apache.org>
> wrote:
>
> > Hi,
> >
> > You will need to use a Label component with ResourceModel instead of
> > <wicket:message>.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Tue, Nov 1, 2016 at 9:02 AM, ganea iulia <su...@gmail.com>
> > wrote:
> >
> > > <wicket:message key="pageTitle">[pageTitle]</wicket:message>
> > >
> > > Hi,
> > > I'm using wicket 7.5.
> > >
> > > I have a parent page, and child pages that extend it: <wicket:extend>
> > >
> > > In my child .properties pages, I always had the pageTitle=My Titile.
> > >
> > > I now need to dinamically change the title of the page, inside my child
> > > page constructor.
> > >
> > > Could you please advise?
> > >
> > > Thank you
> > >
> >
>
Re: How to access wicket parent page wicket:message
Posted by ganea iulia <su...@gmail.com>.
Hello,
Could you please provide an example?
I have added the below line in my constructor, but nothing appears where
the title should be.
add(new Label("pageTitle", new ResourceModel("pageTitle", "my title")));
In the child .properties files I have left the pageTitle empty: pageTitle=
In the child .html page, I haven't added anything.
Thank you.
On Tue, Nov 1, 2016 at 10:14 AM, Martin Grigorov <mg...@apache.org>
wrote:
> Hi,
>
> You will need to use a Label component with ResourceModel instead of
> <wicket:message>.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Nov 1, 2016 at 9:02 AM, ganea iulia <su...@gmail.com>
> wrote:
>
> > <wicket:message key="pageTitle">[pageTitle]</wicket:message>
> >
> > Hi,
> > I'm using wicket 7.5.
> >
> > I have a parent page, and child pages that extend it: <wicket:extend>
> >
> > In my child .properties pages, I always had the pageTitle=My Titile.
> >
> > I now need to dinamically change the title of the page, inside my child
> > page constructor.
> >
> > Could you please advise?
> >
> > Thank you
> >
>
Re: How to access wicket parent page wicket:message
Posted by Martin Grigorov <mg...@apache.org>.
Hi,
You will need to use a Label component with ResourceModel instead of
<wicket:message>.
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Tue, Nov 1, 2016 at 9:02 AM, ganea iulia <su...@gmail.com> wrote:
> <wicket:message key="pageTitle">[pageTitle]</wicket:message>
>
> Hi,
> I'm using wicket 7.5.
>
> I have a parent page, and child pages that extend it: <wicket:extend>
>
> In my child .properties pages, I always had the pageTitle=My Titile.
>
> I now need to dinamically change the title of the page, inside my child
> page constructor.
>
> Could you please advise?
>
> Thank you
>