flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Martin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-34878) error property of NumberFormatter returns null and not it's default value
Date Tue, 09 Jun 2015 05:14:00 GMT

    [ https://issues.apache.org/jira/browse/FLEX-34878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14578330#comment-14578330

Chris Martin commented on FLEX-34878:

Adjusted description of the issue.  Determined that it is more accurate to say that we will
receive null only if all locales set in the localeChain property are not compiled in. Basically
resulting in the inability to find the appropriate string value to return.

> error property of NumberFormatter returns null and not it's default value
> -------------------------------------------------------------------------
>                 Key: FLEX-34878
>                 URL: https://issues.apache.org/jira/browse/FLEX-34878
>             Project: Apache Flex
>          Issue Type: Improvement
>            Reporter: Chris Martin
>            Assignee: Chris Martin
>            Priority: Trivial
> Steps to reproduce:
> Build an application from the following code:
> {code:actionscript}
> <?xml version="1.0" encoding="utf-8"?>
> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
>     <mx:Script>
>     <![CDATA[
>         import mx.formatters.NumberFormatter;
>         private function onCC():void
>         {
>             var nf:NumberFormatter = new NumberFormatter();
>             nf.precision = 2;
>             resourceManager.localeChain = ['zh-Hans'];
>             trace("number:"+nf.format(1/3));
>             trace("error: " + nf.error);
>         } 
>     ]]>
>     </mx:Script>
> </mx:WindowedApplication>
> {code}
> Compile the application but do not compile in a locale resource set for zh-Hans. Only
compile in 'en_US'.
> Test the application and note that the first trace statement will return blank and the
second trace statement of the error property returns null.
> Because the zh-Hans locale was not compiled in we are unable to know what language to
use to display the default error message of "Invalid format".
> Would like to add in a comment into the asdocs informing the user that if none of the
locales in the localeChain property of the ResourceManager are not compiled in, then it will
return null.

This message was sent by Atlassian JIRA

View raw message