You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 22 Members of 4546 |
| Forum: Seam Users |
19. Aug 2008, 21:23 CET | Link |
Hi,
How can I add a message to messages.properties which has a variable? Example:
newmails=You have {0} new mails.
If I then write: <h:outputText value="#{messages.newmails}" <f:param value="#{user.newMails.count}/> </h:outputText>
it doesn't work. I found a bug about this here.
Is there any other way to do this with Seam?
thanks, Ben
Did you try this ?
newmails=You have #{user.newMails.count} new mails.http://docs.jboss.com/seam/2.1.0.A1/reference/en/html/i18n.html#d0e9302
Maybe not what you really want.
You also have this option
<h:outputFormat value="#{messages.newmails}}"> <f:param value=""#{user.newMails.count}"/> </h:outputFormat>Cheers
Right. Not what I want.
That doesn't work in Seam, and that's precisely the problem. See the bug I linked to above. It works in a plain JSF application, but not Seam apps.
Hi Ben
I've been testing this myself
newmails=You have {0} new mails.<h:outputFormat value="#{messages.newmails}"> <f:param value="#{user.newMails.count}"/> </h:outputFormat>It just works.
My version of seam is 2.0.2.SP1 and I use jboss-4.2.3.GA
Cheers
But I being poor have only my dreams. I have spread my dreams under your feet. Tread softly because you tread on my dreams...
Hi.
We have used the following:
<h:outputText value="#{interpolator.interpolate(messages.our_message, myBean.value}" />Which then displays the message with the data we want. #{interpolator} is a builtin seam component.