here's normal code for a normal label:
<h:outputText value="#{msg['general.costdeviation.status.accepted']}" id="status" />
which will output the locale-dependent text for the label general.costdeviation.status.accepted, e.g. for english:
Accepted
but what if i want to dynamically ask for labels depending on the postfix, e.g. if i have multiple labels with an identical prefix, e.g.:
general.costdeviation.status.accepted=Accepted
general.costdeviation.status.negotiating=Negotiating
general.costdeviation.status.open=Open
general.costdeviation.status.proposed=Proposed
here's how you'd do it, dynamically:
<h:outputText value="#{msg['general.costdeviation.status.'.concat(detail.status)]}" escape="false" id="status" />
where the backing value for #{detail.status} can be one of the following:
accepted
negotiating
open
proposed
thanks to this post: Concatenating strings within EL expression defined in an attribute of a facelets tag
IT, computer and programming tutorials and tips that i couldnt find anywhere else using google, from my daily work as a Senior Developer of solutions using Java and Linux.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment