webtier@glassfish.java.net

Re: [webtier] JSF 1.2 Bundle Messages

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Wed, 22 Jul 2009 07:59:32 -0700

On 7/22/09 7:48 AM, Jeffrey Blattman wrote:
> unfortunately, i'm using icefaces, and the ice:inputText doesn't
> support requiredMessage.
Sounds like a good RFE.
>
> On 7/21/09 10:58 AM, Ryan Lubke wrote:
>> On 7/21/09 8:00 AM, webtier_at_javadesktop.org wrote:
>>> Hi, is it possible to define different bundle messages for an specified event? Example:
>>>
>>> javax.faces.component.UIInput.REQUIRED = value is required
>>>
>>> In page X, i want this message to be showed, so no problem example:
>>>
>>> <h:inputText value="#{anywhere.value}" required="true"/>
>>>
>>> But in the page Y i wanted another message with parameters for the same required situation.
>>>
>>> javax.faces.component.UIInput.REQUIRED_CUSTOM = value is required for {2}
>>>
>>> <h:inputText value="#{anywhere.value}" required="true" label="Anywhere Input"/>
>>>
>>> The problem is: now i will get the other message not this custom one. How could i say to the Faces that now i want to use another bundle-message?
>>>
>> You could define a resource bundle in the faces config with your
>> alternate messages like:
>>
>> |<||application||>|
>> ||| ||<||resource-bundle||>|
>> ||| ||<||base-name||>some.other.Bundle</||base-name||>|
>> ||| ||<||var||>custom</||var||>|
>> ||| ||</||resource-bundle||>|
>> ||| ||</||application||>|
>>
>> Then in your inputText use:
>> requiredMessage="#{custom['messageBundleKey']}" />
>>
>> You can associate different bundles with different variables names
>> using this method.
>>> Thks in advance,
>>>
>>> Israel
>>> [Message sent by forum member 'israelbgf' (israelbgf)]
>>>
>>> http://forums.java.net/jive/thread.jspa?messageID=356773
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:webtier-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail:webtier-help_at_glassfish.dev.java.net
>>>
>>>
>>