Hi all,
I have a HashMap I need to localise like so:
LinkedHashMap<String, String> options = new LinkedHashMap<String,
String>();
options.put("1", new StringResourceModel(option.1",
this,null).getString());
options.put("2", new StringResourceModel("option.2",
this,null).getString());
options.put("3", new StringResourceModel("option.3",
this,null).getString());
But I can't get around this error:
WARN: Tried to retrieve a localized string for a component that has
not yet been added to the page. This can sometimes lead to an invalid
or no localized resource returned. Make sure you are not calling
Component#getString() inside your Component's constructor.
This is being used in a Panel that makes up the content of a
ModalWindow. When the page loads that contains the ModalWindow, the
errors are thrown for each getString() call.
The exact same code works on a normal Page (ie not in a ModalWindow).
Anyone know what is up/how to get around it? It does actually work
fine, ie it renders as normal.
Wicket 1.3.5
cheers,
Steve