I’m generating text inputs in an iterator from a collection I find in a managed bean.
How can I dynamically display the label with a resource bundle message I receive from this bean?
<af:iterator id="i3" var="myVar" value="#{pageFlowScope.MyBean.myCollection}">
<af:inputText id="it4" label="#{myVar.name}" value="#{myVar.value}" />
</af:iterator>
Here, myVar.name is a String representation of a key present in the bundle, like button.label.field or anything else.
Is it possible to pass this String as a parameter to my bundle reference?
Something like: label="#{myBundle[ #{myVar.name} ]}"?
I tried with c:set and with ui:param like proposed in this thread but it doesn’t work.
Thank you for your help.
I’ve been stupid, and finally found the answer… My resource bundle was empty (deleted it and then forgot to fill it again).
So this is the solution:
<c:set var="nameKey" value="#{myVar.name}"/><af:inputText id="it4" value="#{bc2Field.value}" label="#{helpdeskBundle[nameKey]}"/>