myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yee-Wah Lee (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Updated] (TRINIDAD-2076) Facelets: LocaleTagPropertyRule does not match jspx implementation
Date Tue, 05 Apr 2011 16:39:05 GMT

     [ https://issues.apache.org/jira/browse/TRINIDAD-2076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Yee-Wah Lee updated TRINIDAD-2076:
----------------------------------

    Status: Patch Available  (was: Open)

> Facelets: LocaleTagPropertyRule does not match jspx implementation 
> -------------------------------------------------------------------
>
>                 Key: TRINIDAD-2076
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2076
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Facelets
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Yee-Wah Lee
>            Priority: Minor
>         Attachments: trunk_2076_LocaleTagPropertyRule.diff
>
>
> 1. Create a facelets page with a converter (e.g. numberConverter, dateTimeConverter)
which has its locale attribute set to a language-country. 
>   <tr:inputText label="ConvNumLocale:" id="it1">
>                 <tr:convertNumber type="currency" locale="pt-BR"/>
>             </tr:inputText>
> 2. Run the app, see the server log error.
> <XhtmlUtils> <addLib> Could not find scriptlet: LocaleInfo_pt-br
> 3. The component does not function because the Locale js file was not loaded. This is
because LocaleTagPropertyRule creates a Locale thus in applyMetadata() :
>     Locale loc = new Locale(_attribute.getValue(ctx));
> which creates a Locale object with language="pt-br". However, the page is actually requesting
a Locale with language=pt, country=br.   Subsequently, it is unable to find the LocaleInfo
scriptlet for the locale with language pt-br.
> In the jspx case, there is a helper method TagUtils#getLocale() which takes the string
and create the Locale based on it. This correctly creates the Locale, and the request for
LocaleInfo scriptlet succeeds.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message