You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Routis Haralampos (JIRA)" <de...@myfaces.apache.org> on 2005/11/30 13:54:29 UTC

[jira] Created: (MYFACES-891) Broken number converter

Broken number converter
-----------------------

         Key: MYFACES-891
         URL: http://issues.apache.org/jira/browse/MYFACES-891
     Project: MyFaces
        Type: Bug
    Versions: 1.1.1    
 Environment: IBM Websphere CE, Windows XP, IBM JDK 1.4.2
    Reporter: Routis Haralampos
    Priority: Critical


I have a managed bean that declares a Float property. If I register in a jsp the  number converter (in greek local)

<f:convertNumber groupingUsed="true" maxFractionDigits="2" minFractionDigits="2"/>

then I get
a) for input =2,00  
     error =javax.faces.el.EvaluationException: Cannot set value for expression '#{drugView.model.value}' to a new value of type java.lang.Long

b) for input=2,31
   error =javax.faces.el.EvaluationException: Cannot set value for expression '#{drugView.model.value}' to a new value of type java.lang.Double

The code works fine in 1.1.0


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-891) Broken number converter

Posted by "Mario Ivankovits (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-891?page=comments#action_12414090 ] 

Mario Ivankovits commented on MYFACES-891:
------------------------------------------

I commited a number converter to tomahawk sandbox which will automatically convert the value to the beans expected type

> Broken number converter
> -----------------------
>
>          Key: MYFACES-891
>          URL: http://issues.apache.org/jira/browse/MYFACES-891
>      Project: MyFaces Core
>         Type: Bug

>     Versions: 1.1.1
>  Environment: IBM Websphere CE, Windows XP, IBM JDK 1.4.2
>     Reporter: Routis Haralampos
>     Assignee: Martin Marinschek
>     Priority: Critical
>      Fix For: 1.1.2

>
> I have a managed bean that declares a Float property. If I register in a jsp the  number converter (in greek local)
> <f:convertNumber groupingUsed="true" maxFractionDigits="2" minFractionDigits="2"/>
> then I get
> a) for input =2,00  
>      error =javax.faces.el.EvaluationException: Cannot set value for expression '#{drugView.model.value}' to a new value of type java.lang.Long
> b) for input=2,31
>    error =javax.faces.el.EvaluationException: Cannot set value for expression '#{drugView.model.value}' to a new value of type java.lang.Double
> The code works fine in 1.1.0

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (MYFACES-891) Broken number converter

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-891?page=all ]
     
Martin Marinschek closed MYFACES-891:
-------------------------------------

    Fix Version: Nightly
     Resolution: Won't Fix
      Assign To: Martin Marinschek

> Broken number converter
> -----------------------
>
>          Key: MYFACES-891
>          URL: http://issues.apache.org/jira/browse/MYFACES-891
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.1.1
>  Environment: IBM Websphere CE, Windows XP, IBM JDK 1.4.2
>     Reporter: Routis Haralampos
>     Assignee: Martin Marinschek
>     Priority: Critical
>      Fix For: Nightly

>
> I have a managed bean that declares a Float property. If I register in a jsp the  number converter (in greek local)
> <f:convertNumber groupingUsed="true" maxFractionDigits="2" minFractionDigits="2"/>
> then I get
> a) for input =2,00  
>      error =javax.faces.el.EvaluationException: Cannot set value for expression '#{drugView.model.value}' to a new value of type java.lang.Long
> b) for input=2,31
>    error =javax.faces.el.EvaluationException: Cannot set value for expression '#{drugView.model.value}' to a new value of type java.lang.Double
> The code works fine in 1.1.0

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-891) Broken number converter

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-891?page=comments#action_12359409 ] 

Martin Marinschek commented on MYFACES-891:
-------------------------------------------

There's been a long, long discussion on the mailing list.

I'll try to summarize for you, even though I didn't take part and might be wrong:

We had a coercion into place in 1.0.9 which would automatically convert a Number to Long or Double for you if you used the NumberConverter on a Backing-Bean with type Long, Double, etc.

This coercion had to go out, as the JSF TCK required it to go. What is left is that if you use a NumberConverter, you'll need to use a Backing-Bean-property with type Number, obviously.

Correct me if I'm wrong!

regards,

Martin

> Broken number converter
> -----------------------
>
>          Key: MYFACES-891
>          URL: http://issues.apache.org/jira/browse/MYFACES-891
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.1.1
>  Environment: IBM Websphere CE, Windows XP, IBM JDK 1.4.2
>     Reporter: Routis Haralampos
>     Priority: Critical
>      Fix For: Nightly

>
> I have a managed bean that declares a Float property. If I register in a jsp the  number converter (in greek local)
> <f:convertNumber groupingUsed="true" maxFractionDigits="2" minFractionDigits="2"/>
> then I get
> a) for input =2,00  
>      error =javax.faces.el.EvaluationException: Cannot set value for expression '#{drugView.model.value}' to a new value of type java.lang.Long
> b) for input=2,31
>    error =javax.faces.el.EvaluationException: Cannot set value for expression '#{drugView.model.value}' to a new value of type java.lang.Double
> The code works fine in 1.1.0

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira