actually.. found out what it was (and the example i gave was incorrect -
oops).
the new Localizer#getCacheKey(String, Component) assumes that for a given
key in the markup, there will only ever be a single translation.
I have my own resource resolver, which allows for resolution of the keys
based on the class of the model object (which saves having to duplicate
translations, and allows me to store translations against the domain
entities). Igor has mentioned this is a bad idea, but it has been VERY
useful, and means that the translations are appropriate outside of the
wicket world (I also use them for web services through another application).
Previously, the following would result in different cache keys based on the
index of the list item - which was good because my custom
StringResourceResolver relied upon it.
<wicket:container wicket:id="createLinks">
# <wicket:message key="entity">[entity]</wicket:message>
</wicket:container>
I have fixed this by overriding the getCacheKey method with the old code.
It could be cleaned up a bit - the cache keys are HUGE...
Rgds
Ned
I'm in the process of updating to 1.4m3.
The following is resulting in the same cache key for each item. (which did
not happen in 1.4m1)
ListView createLinks = new ListView<Link>("createLinks", links) {
protected void populateItem(ListItem<Link> item) {
Link link = item.getModelObject();
link.add(new Label("banana"))
item.add(link);
}
};
Is this the correct behaviour? It's causing my links to all have the same
label (ie, whichever was hit first)
Rgds
Ned
igor.vaynberg wrote:
>
> should be fixed in m3 which is coming out any hour
>
> -igor
>
--
View this message in context:
http://www.nabble.com/wicket-1.4---Localizer-getCacheKey-BUG-tp18421093p20449836.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]