wicket-select2
wicket-select2 copied to clipboard
Not possible to add custom system labels for the Select2Choice
In Select2ChoiceBaseComponent there is the getEscapedJsString function:
protected String getEscapedJsString(String key) {
String value = getString(key);
return Strings.replaceAll(value, "'", "\\'").toString();
}
which is called multiple times in the onInitialize function, for example:
getSettings().setFormatNoMatches("function() { return '" + getEscapedJsString("noMatches") + "';}");
In this way it is not possible to add your own labels, since it is always overwritten by the system defaults. For example getSettings().setFormatNoMatches("foo") will not result in a label "foo" when there are matches.