Please take a look at this and tell me what you think.  I'm on 1.4-m2
(haven't upgraded to m3 yet - but looking forward to it).

Localizer : 332
            while (cursor != null)
            {
                buffer.append("-").append(cursor.getClass().getName());
                buffer.append(":").append(cursor.getId());
                cursor = cursor.getParent();
                if (cursor instanceof Page)
                    break;
            }

I think that the cursor = cursor.getParent(); needs to go after the if /
break check.  In my case, I have two subclasses of SomePage, each containing
SomePanel, which contains SomeOtherPanel, which has a label in it with
string resource model (same happens with wicket:message).  The cache key
ends up being
RESOURCE-KEY-SomeOtherPanelClassName:SomeOtherPanelWicketID-SomePanelClassName:SomeOtherPanelWicketID

If it were:
RESOURCE-KEY-SomeOtherPanelClassName:SomeOtherPanelWicketID-SomePanelClassName:SomeOtherPanelWicketID:SomePageTypeOne
and
RESOURCE-KEY-SomeOtherPanelClassName:SomeOtherPanelWicketID-SomePanelClassName:SomeOtherPanelWicketID:SomePageTypeTwo
then the resources would be looked up properly in SomePageTypeOne.properties
and SomePageTypeTwo.properties - which is the exact situation I have.

Is there a reason the page isn't included in the cache key?  This seems
suspicious to me.  There are many times that you might have the same
component tree, but in different pages, and need different resources loaded
for each, especially with naming patterns where your panels end up with
similar names across many pages.

I tried this by copying the code for Localizer to my local source tree and
changing it there - it works great.  Something must've changed in one of the
1.4 versions (I haven't looked to see where) because this used to work fine
for me, pulling the values from the correct properties files.

Thanks!
Jeremy Thomerson

Reply via email to