cancel
Showing results for 
Search instead for 
Did you mean: 

How to display i18n labels for list constraint values?

buddycasino
Champ in-the-making
Champ in-the-making
Hi,

how can I display internationalized labels for the values (defined in a list constraint) in a select list?
I can regsiter a custom converter in my web-client-config-custom.xml, but that is for the value only, not for the label it seems.
2 REPLIES 2

zomurn
Champ in-the-making
Champ in-the-making
What about using the property key as value of the list ?

<list>
  <value>my.property.key</value>
</list>

…inside the jsp :

a scriplet to retrieve the value in the bundle :

ResourceBundle bundle = ResourceBundle.getBundle(
"com.dzafer.MessageResources", context.getViewRoot()
.getLocale());

String msg = bundle.getString(value of the property of the node);
context.addMessage(null, new FacesMessage(msg));


display with something like <hSmiley Surprisedutputtext  value="#{}"/> or cSmiley Surprisedut through JSTL . You may need to put the string msg in the page or request scope in order to access it in a tag way.

zomurn
Champ in-the-making
Champ in-the-making
Or the idea of the converter may be cleaner…