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 12:51:32 UTC

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

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


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

Posted by "Guido Dubois (JIRA)" <de...@myfaces.apache.org>.
    [ 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.


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

Posted by "Guido Dubois (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOBAGO-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483839 ] 

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

If using simple type double, the field is initially preset with "0,00" (assumed pattern="#,##0.00") and it seems that you can't clear the field...

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


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

Posted by "Guido Dubois (JIRA)" <de...@myfaces.apache.org>.
    [ 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.


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

Posted by "Guido Dubois (JIRA)" <de...@myfaces.apache.org>.
    [ 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.