Re: How to access wicket parent page wicket:message

2016-11-01 Thread Martin Grigorov
On Tue, Nov 1, 2016 at 10:06 AM, ganea iulia  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:
> [pageTitle]
>
> 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 
> 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  and add wicket:id="pageTitle" on the
> >  element.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Tue, Nov 1, 2016 at 9:39 AM, ganea iulia 
> > 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  >
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > You will need to use a Label component with ResourceModel instead of
> > > > .
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > > > On Tue, Nov 1, 2016 at 9:02 AM, ganea iulia 
> > > > wrote:
> > > >
> > > > > [pageTitle]
> > > > >
> > > > > Hi,
> > > > > I'm using wicket 7.5.
> > > > >
> > > > > I have a parent page, and child pages that extend it:
> 
> > > > >
> > > > > 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

2016-11-01 Thread ganea iulia
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:
[pageTitle]

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 
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  and add wicket:id="pageTitle" on the
>  element.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Nov 1, 2016 at 9:39 AM, ganea iulia 
> 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 
> > wrote:
> >
> > > Hi,
> > >
> > > You will need to use a Label component with ResourceModel instead of
> > > .
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Tue, Nov 1, 2016 at 9:02 AM, ganea iulia 
> > > wrote:
> > >
> > > > [pageTitle]
> > > >
> > > > Hi,
> > > > I'm using wicket 7.5.
> > > >
> > > > I have a parent page, and child pages that extend it: 
> > > >
> > > > 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

2016-11-01 Thread Martin Grigorov
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  and add wicket:id="pageTitle" on the
 element.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Nov 1, 2016 at 9:39 AM, ganea iulia  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 
> wrote:
>
> > Hi,
> >
> > You will need to use a Label component with ResourceModel instead of
> > .
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Tue, Nov 1, 2016 at 9:02 AM, ganea iulia 
> > wrote:
> >
> > > [pageTitle]
> > >
> > > Hi,
> > > I'm using wicket 7.5.
> > >
> > > I have a parent page, and child pages that extend it: 
> > >
> > > 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

2016-11-01 Thread ganea iulia
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 
wrote:

> Hi,
>
> You will need to use a Label component with ResourceModel instead of
> .
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Nov 1, 2016 at 9:02 AM, ganea iulia 
> wrote:
>
> > [pageTitle]
> >
> > Hi,
> > I'm using wicket 7.5.
> >
> > I have a parent page, and child pages that extend it: 
> >
> > 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

2016-11-01 Thread Martin Grigorov
Hi,

You will need to use a Label component with ResourceModel instead of
.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Nov 1, 2016 at 9:02 AM, ganea iulia  wrote:

> [pageTitle]
>
> Hi,
> I'm using wicket 7.5.
>
> I have a parent page, and child pages that extend it: 
>
> 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
>