You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by smallufo <sm...@gmail.com> on 2008/06/05 22:29:02 UTC

Does StringResourceModel honor container's key (rather than its own ?)

I have a Web Page , containing a Panel , both components have the same key
in each property files (but with different values).
I found in the Panel , when calling
new StringResourceModel("key" , this , null) ,
it will return Page's key value , not its own value .
Is it intentional ? or a bug ?

Wicket 1.3.3

Re: Does StringResourceModel honor container's key (rather than its own ?)

Posted by James Carman <ja...@carmanconsulting.com>.
I would suggest starting from a "quickstart" application and adding in
the code that illustrates this issue.  If you can come up with
something that you think is a bug, file a JIRA issue.

On Thu, Jun 5, 2008 at 5:42 PM, smallufo <sm...@gmail.com> wrote:
> 2008/6/6 James Carman <ja...@carmanconsulting.com>:
>
>> Show some code.  What is "this" at the point you're instantiating SRM?
>>
>
> The following codes are written in MyPanel's constructor:
>
> collapseExpandText = new Label("collapseExpandText");
> collapseExpandText.setOutputMarkupPlaceholderTag(true);
> if (checkGroup.isVisible())
>  collapseExpandText.setModel(new StringResourceModel("collapse" , this ,
> null));
> else
>  collapseExpandText.setModel(new StringResourceModel("expand" , this ,
> null));
>
> Both my panel and it containing WebPage have "collapse" and "expand" key
> (but with different values).
> But it only shows WebPage's values , not its own values.
> I tried to change "collapse"/"expand" to another key , ex : "collapseX" ,
> "expandX" ,
> and edit the corresponding MyPanel's properties keys ,
> it then shows MyPanel's values , not WebPage.
>
> So , I am sure , StringResourceModel honors its container's key , not its
> own.
> Is it intentional ?
>
>
> On Thu, Jun 5, 2008 at 4:29 PM, smallufo <sm...@gmail.com> wrote:
>> I have a Web Page , containing a Panel , both components have the same key
>> in each property files (but with different values).
>> I found in the Panel , when calling
>> new StringResourceModel("key" , this , null) ,
>> it will return Page's key value , not its own value .
>> Is it intentional ? or a bug ?
>>
>> Wicket 1.3.3
>>
>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Does StringResourceModel honor container's key (rather than its own ?)

Posted by smallufo <sm...@gmail.com>.
2008/6/6 James Carman <ja...@carmanconsulting.com>:

> Show some code.  What is "this" at the point you're instantiating SRM?
>

The following codes are written in MyPanel's constructor:

collapseExpandText = new Label("collapseExpandText");
collapseExpandText.setOutputMarkupPlaceholderTag(true);
if (checkGroup.isVisible())
  collapseExpandText.setModel(new StringResourceModel("collapse" , this ,
null));
else
  collapseExpandText.setModel(new StringResourceModel("expand" , this ,
null));

Both my panel and it containing WebPage have "collapse" and "expand" key
(but with different values).
But it only shows WebPage's values , not its own values.
I tried to change "collapse"/"expand" to another key , ex : "collapseX" ,
"expandX" ,
and edit the corresponding MyPanel's properties keys ,
it then shows MyPanel's values , not WebPage.

So , I am sure , StringResourceModel honors its container's key , not its
own.
Is it intentional ?


On Thu, Jun 5, 2008 at 4:29 PM, smallufo <sm...@gmail.com> wrote:
> I have a Web Page , containing a Panel , both components have the same key
> in each property files (but with different values).
> I found in the Panel , when calling
> new StringResourceModel("key" , this , null) ,
> it will return Page's key value , not its own value .
> Is it intentional ? or a bug ?
>
> Wicket 1.3.3
>

---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Does StringResourceModel honor container's key (rather than its own ?)

Posted by James Carman <ja...@carmanconsulting.com>.
Show some code.  What is "this" at the point you're instantiating SRM?


On Thu, Jun 5, 2008 at 4:29 PM, smallufo <sm...@gmail.com> wrote:
> I have a Web Page , containing a Panel , both components have the same key
> in each property files (but with different values).
> I found in the Panel , when calling
> new StringResourceModel("key" , this , null) ,
> it will return Page's key value , not its own value .
> Is it intentional ? or a bug ?
>
> Wicket 1.3.3
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org