[ 
https://issues.apache.org/jira/browse/TOBAGO-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12513742
 ] 

Guido Dubois commented on TOBAGO-335:
-------------------------------------

This works with empty fields!

The error message corresponds to an other field of simple double type.

> <f:convertNumber type="number"> and Double object in backing bean
> -----------------------------------------------------------------
>
>                 Key: TOBAGO-335
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-335
>             Project: MyFaces Tobago
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.10
>            Reporter: Guido Dubois
>
> If you need to clear an input field, the easiest way is to use an object type 
> like String, Date or Double. So you can set it simply to null and the field 
> will be cleared. But in case of Double there will be a problem with 
> <f:convertNumber>.
> In RI there is the same problem. See issue 
> https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=286 for more 
> details.
> This workaround helps:
> <tx:in value="#{bbg.f3}" label="field3" labelWidth="120px">
>   <f:convertNumber type="number" maxFractionDigits="2" pattern="#,##0.00" />
> </tx:in>
> ...
> private Number f1;
> private Double f1double;
> ...  
> public Number getF1() {
>   return f1double;
> }
> public void setF1(Number f1) {
>   this.f1double = f1.doubleValue();
> }

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

Reply via email to