This content has been marked as final.
Show 5 replies
-
1. Re: How to put a parameter into a localized string
ztiringer Nov 16, 2009 5:12 AM (in response to ifischer)@In
private FacesMessages facesMessages;and then
facesMessages.addFromResourceBundle(
myMessage
, param ); -
2. Re: How to put a parameter into a localized string
ifischer Nov 19, 2009 11:01 PM (in response to ifischer)Thank you, Zoltan! But what i needed was a solution to use directly on a jsf page. I finally came up with this one, which works fine for me:
<h:outputFormat value="#{messages['myParamMessage']}"> <!-- put parameter into localized string --> <f:param value="#{param}"/> </h:outputFormat>
-
3. Re: How to put a parameter into a localized string
mgvanbochove Dec 1, 2009 1:51 PM (in response to ifischer)Is it also possible to use this construction for a attribute of a tag. example:
<rich:simpleTogglePanel switchType="ajax" label="message from messagebundle with paramters">
...
</rich:simpleTogglePanel>
I should want something like this, but unfortunately the value attribute of the attribute core tag (f:attribute) is required and can't use it's body:
<rich:simpleTogglePanel switchType="ajax">
<f:attribute name="label">
<!-- value attribute determined by result of outputFormat -->
<h:outputFormat value="#{messages['myParamMessage']}">
<!-- put parameter into localized string -->
<f:param value="#{param}"/>
</h:outputFormat>
</f:attribute>
...
</rich:simpleTogglePanel>
Is there a solution to this problem? -
4. Re: How to put a parameter into a localized string
kenfrommera Dec 1, 2009 2:03 PM (in response to ifischer)
Ingo Fischer wrote on Nov 19, 2009 23:01:
Thank you, Zoltan! But what i needed was a solution to use directly on a jsf page. I finally came up with this one, which works fine for me:You can use
"#{interpolator.interpolate(messages['myMessage'], myParam1, myParam2)}"
-
5. Re: How to put a parameter into a localized string
mgvanbochove Dec 1, 2009 2:28 PM (in response to ifischer)Thank you, it works!