You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Chris Martin (JIRA)" <ji...@apache.org> on 2015/06/06 07:33:00 UTC

[jira] [Commented] (FLEX-34878) error property of NumberFormatter returns null and not it's default value

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

Chris Martin commented on FLEX-34878:
-------------------------------------

This issue led to the discovery of the error property not returning it's default values under certain conditions

> 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" creationComplete="onCC();">
>     <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 using that the error property cannot return the default values in the requested locale has not been compiled in.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)