myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabrielle Crawford (JIRA)" <...@myfaces.apache.org>
Subject [jira] Issue Comment Edited: (TRINIDAD-1489) get a valueChangeEvent for bigDecimal even though user didn't make a change.
Date Fri, 22 May 2009 23:44:45 GMT

    [ https://issues.apache.org/jira/browse/TRINIDAD-1489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712307#action_12712307
] 

Gabrielle Crawford edited comment on TRINIDAD-1489 at 5/22/09 4:44 PM:
-----------------------------------------------------------------------

added a test case on 1.2.11.3 branch to see 'before' behavior in revision: 777741  
http://svn.apache.org/viewvc?view=rev&revision=777741

If you run the demo page, and don't change anything, but just hit the submit button on the
test page you get a valueChangeEvent fired for the inputText with bigdecimal, even though
you didn't change anything.

      was (Author: gabrielle):
    added a test case on 1.2.11.3 branch to see 'before' behavior in revision: 777741  
http://svn.apache.org/viewvc?view=rev&revision=777741
  
> get a valueChangeEvent for bigDecimal even though user didn't make a change.
> ----------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1489
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1489
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>            Reporter: Gabrielle Crawford
>
> When attribute data type is BigDecimal and <af:convertNumber> is used Trin treats
the attribute as if the attribute value is changed even though the attribute value has not
been changed.
> Under the covers the numberConverter is using the java decimalFormat class, and things
can get a little funny when you use bigdecimal, because bigdecimal remembers formatting information
like scale. So 2.0 is not equal to 2.00 in bigdecimal.
> We can add logic to UIXEditableValueHolder that if .equals fails and if the values are
the same type and implement comparable we should then check compareTo.
> There are 2 workarounds for now.
> 1] apply the pattern to the bigdecimal in the getter, so in the salary
> example code above return newSal instead of sal.
> 2] check compareTo in the setter, and don't set if you get 0.

-- 
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