StringResourceModel honors container's key (rather than its own)
----------------------------------------------------------------

                 Key: WICKET-1691
                 URL: https://issues.apache.org/jira/browse/WICKET-1691
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.3
         Environment: Wicket 1.3.3 , resin-3.0.25 , Linux
            Reporter: smallufo


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 .

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 ? or a bug ? 
If it is intentional , it seems not reasonable.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to