You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Kołoszko Paweł <pa...@atena.pl> on 2005/11/16 11:44:56 UTC

How to work now with number converter (previously: I need myfaces 1.1.0 nightly build)

 
Ok., I've checked it. I have something like that:

<x:inputText id="kosztInput" value="#{listRodzajeDzialan.number}" required="false">	
	<f:convertNumber type="number"/>
</x:inputText>

If listRodzajeDzialan.number is Long then there is no converter error.
If listRodzajeDzialan.number is Double then there is converter error.
If listRodzajeDzialan.number is BigDecimal then there is converter error.
If listRodzajeDzialan.number is Number then there is no converter error.

Does it mean that now we can not use fields of type Double or BigDecimal in backing beans if we want to use number converter? And I have to change type of my fields to Number?

PK


-----Original Message-----
From: Martin Marinschek [mailto:martin.marinschek@gmail.com] 
Sent: Wednesday, November 16, 2005 11:12 AM
To: MyFaces Discussion
Subject: Re: I need myfaces 1.1.0 nightly build

Hi Pawel,

736 obviously is no bug - it is the behaviour prescribed by the TCK.

So you'll probably need to change your backing beans to accustomate for this.

regards,

Martin

On 11/16/05, Kołoszko Paweł <pa...@atena.pl> wrote:
>
> I just switched from myfaces 1.0.9 to 1.1.1 and unfortunately I can 
> not work with it because of bug MYFACES-736. I switched to 1.1.0 
> (official version), where this problem do not exist, but there are 
> problems with jsCookMenu in 1.1.0. In this situation I would like to 
> check a 1.1.0 nightly build as late as possible. Can anyone help me?
>
> Pawel Koloszko
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: How to work now with number converter (previously: I need myfaces 1.1.0 nightly build)

Posted by Yannick Le Teigner <ya...@laposte.net>.
You are correct. I faced the issue lately too, you have to use 
java.lang.Number in your backing bean.

Yannick

Kołoszko Paweł wrote:

> 
>Ok., I've checked it. I have something like that:
>
><x:inputText id="kosztInput" value="#{listRodzajeDzialan.number}" required="false">	
>	<f:convertNumber type="number"/>
></x:inputText>
>
>If listRodzajeDzialan.number is Long then there is no converter error.
>If listRodzajeDzialan.number is Double then there is converter error.
>If listRodzajeDzialan.number is BigDecimal then there is converter error.
>If listRodzajeDzialan.number is Number then there is no converter error.
>
>Does it mean that now we can not use fields of type Double or BigDecimal in backing beans if we want to use number converter? And I have to change type of my fields to Number?
>
>PK
>
>
>-----Original Message-----
>From: Martin Marinschek [mailto:martin.marinschek@gmail.com] 
>Sent: Wednesday, November 16, 2005 11:12 AM
>To: MyFaces Discussion
>Subject: Re: I need myfaces 1.1.0 nightly build
>
>Hi Pawel,
>
>736 obviously is no bug - it is the behaviour prescribed by the TCK.
>
>So you'll probably need to change your backing beans to accustomate for this.
>
>regards,
>
>Martin
>
>On 11/16/05, Kołoszko Paweł <pa...@atena.pl> wrote:
>  
>
>>I just switched from myfaces 1.0.9 to 1.1.1 and unfortunately I can 
>>not work with it because of bug MYFACES-736. I switched to 1.1.0 
>>(official version), where this problem do not exist, but there are 
>>problems with jsCookMenu in 1.1.0. In this situation I would like to 
>>check a 1.1.0 nightly build as late as possible. Can anyone help me?
>>
>>Pawel Koloszko
>>
>>    
>>
>
>
>--
>
>http://www.irian.at
>
>Your JSF powerhouse -
>JSF Consulting, Development and
>Courses in English and German
>
>Professional Support for Apache MyFaces
>
>  
>

Re: How to work now with number converter (previously: I need myfaces 1.1.0 nightly build)

Posted by Mike Kienenberger <mk...@gmail.com>.
On 11/16/05, Kołoszko Paweł <pa...@atena.pl> wrote:
> If listRodzajeDzialan.number is Long then there is no converter error.
> If listRodzajeDzialan.number is Double then there is converter error.

Whether the above is true is going to depend on the input being
converted.  Sometimes you're going to get a Long and sometimes you're
going to get a Double.

You need to always use Number.   You can then use the Number *Value()
methods to convert it to whatever type you need.