You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Guido Dubois (JIRA)" <de...@myfaces.apache.org> on 2007/03/24 13:02:33 UTC

[jira] Commented: (TOBAGO-335) and Double object in backing bean

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

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

annotation: If the input field is disabled, there is no problem with Double

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