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 <mgrigo...@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 <superbiss...@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 <mgrigo...@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 <superbiss...@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
> > > >
> > >
> >
>

Reply via email to