myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guido Dubois (JIRA)" <...@myfaces.apache.org>
Subject [jira] Commented: (TOBAGO-335) <f:convertNumber type="number"> and Double object in backing bean
Date Sun, 25 Mar 2007 08:15:32 GMT

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

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

correction:

public void setF1(Number f1) {
  this.f1double = null;
  if (f1 != null) {
    this.f1double = f1.doubleValue();
  }
}

This doesn't works for empty fields.

Component: page:_idJsp30 
Severity : Error
Summary  : Exception setting property f3 of base with class de.ibs.bbg.SessionController,
Bean: de.ibs.bbg.SessionController, property: f3, newValue:  null ,newValue class:  null 
method parameter class: double, null 


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


Mime
View raw message