Details
Description
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.