myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias Weßendorf (JIRA) <...@myfaces.apache.org>
Subject [jira] Updated: (TRINIDAD-1421) incorrect convertNumber behavior when integerOnly="true"
Date Tue, 21 Jul 2009 17:30:14 GMT

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

Matthias Weßendorf updated TRINIDAD-1421:
-----------------------------------------

       Resolution: Fixed
    Fix Version/s:  1.2.12-core
           Status: Resolved  (was: Patch Available)

> incorrect convertNumber behavior when integerOnly="true"
> --------------------------------------------------------
>
>                 Key: TRINIDAD-1421
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1421
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>            Reporter: Cale Scholl
>            Assignee: Matthias Weßendorf
>            Priority: Minor
>             Fix For:  1.2.12-core
>
>         Attachments: 1.2.11.4-branch_integerOnly.patch, trunk_integerOnly.patch
>
>
> If you have
> <af:inputText id="it1" label="Label 1">
>    <af:convertNumber integerOnly="true" />
> </af:inputText>
> then entering a fractional value (i.e. 23.45) causes an error to be thrown, which is
wrong; instead, just the integer part should be parsed and formatted.
> When the converter is an instance of "TrIntegerConverter", it calls _decimalParse, which
calls parseInt, and that is why we're seeing the error. The problem is in trinidad-impl\src\main\java\org\apache\myfaces\trinidadinternal\convert\NumberConverter.java
-> _getTrNumberConverter:
>       if(this.isIntegerOnly() && this.getPattern() == null && "number".equals(this.getType()))
>       {
>         outBuffer.append("new TrIntegerConverter(");
>         outBuffer.append("null,null,0,");
>         outBuffer.append(IntegerUtils.getString(Integer.MAX_VALUE));
>         outBuffer.append(',');
>         outBuffer.append(IntegerUtils.getString(Integer.MIN_VALUE));
>         outBuffer.append(")");
>       }
> I think creating a TrIntegerConverter instance isn't appropriate under any circumstances,
so we should probably just remove the above if-clause.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message