You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Anthony Hong <an...@gmail.com> on 2006/03/14 09:18:30 UTC
How to set parameter in resource bundle in page
IN JSF page, usual do i18n like
<f:loadBundle basename="#{facesContext.application.messageBundle}"
var="tagVar"/>
then <h:outputText value="#{tagVar.TEMPLATE_LOGIN_USER}"/>:
I have a question how to use a composite message. like
tagKey=We met for {0} days
--
Anthony Hong
Re: How to set parameter in resource bundle in page
Posted by Anthony Hong <an...@gmail.com>.
Great solution.
Thanks Arvid
On 3/14/06, Arvid Hülsebus <ar...@atanion.com> wrote:
> You can use <h:outputFormat> like this:
>
> <h:outputFormat value="#{bundle.list_footer}">
> <f:param value="#{controller.addressCount}" />
> </h:outputFormat>
>
> Regards,
> Arvid
>
> Anthony Hong wrote:
>
> >IN JSF page, usual do i18n like
> ><f:loadBundle basename="#{facesContext.application.messageBundle}"
> >var="tagVar"/>
> >
> >then <h:outputText value="#{tagVar.TEMPLATE_LOGIN_USER}"/>:
> >
> >I have a question how to use a composite message. like
> >tagKey=We met for {0} days
> >
> >--
> >
> >Anthony Hong
> >
> >
> >
>
--
Anthony Hong
Re: How to set parameter in resource bundle in page
Posted by Arvid Hülsebus <ar...@atanion.com>.
You can use <h:outputFormat> like this:
<h:outputFormat value="#{bundle.list_footer}">
<f:param value="#{controller.addressCount}" />
</h:outputFormat>
Regards,
Arvid
Anthony Hong wrote:
>IN JSF page, usual do i18n like
><f:loadBundle basename="#{facesContext.application.messageBundle}"
>var="tagVar"/>
>
>then <h:outputText value="#{tagVar.TEMPLATE_LOGIN_USER}"/>:
>
>I have a question how to use a composite message. like
>tagKey=We met for {0} days
>
>--
>
>Anthony Hong
>
>
>
RE: How to set parameter in resource bundle in page
Posted by Frank Felix Debatin <ff...@gmx.net>.
Anthony,
we solved this by defining our own EL function in the facelets tag library:
<function>
<function-name>message</function-name>
<function-class>bamboo.web.faces.Helpers</function-class>
<function-signature>
java.lang.String message(java.lang.String, java.lang.Object)
</function.signature>
</function>
you guess the implementation. Then use it such as:
<h:outputText value="#{bb:message(tagKey, tagVar.TEMPLATE_LOGIN_USER)}"/>
where bb is our own namespace.
Frank Felix
-----Original Message-----
From: Anthony Hong [mailto:anthony.bin.hong@gmail.com]
Sent: Tuesday, March 14, 2006 9:18 AM
To: MyFaces Discussion
Subject: How to set parameter in resource bundle in page
IN JSF page, usual do i18n like
<f:loadBundle basename="#{facesContext.application.messageBundle}"
var="tagVar"/>
then <h:outputText value="#{tagVar.TEMPLATE_LOGIN_USER}"/>:
I have a question how to use a composite message. like tagKey=We met for {0}
days
--
Anthony Hong