You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Adrian Mitev <ad...@googlemail.com> on 2006/11/14 10:24:26 UTC

Problem with f:convertNumber

Hi all! I`m using myfaces 1.1.5 nightly build. I've created my own convertor
for BigDecimal to show error message that is oriented to the big decimal
object. I have form with input field that is binded to big decimal.
Everything works fine. Now i want to put a convertor that will cut some
fraction digits - <f:convertNumber maxFractionDigits="5" />. When the page
is rendered everything is ok but when i submit the form i got the following
as <h:message> for the input component:
Exception setting property taxBase of base with class
org.cts.web.bean.WareDTO, Bean: org.cts.web.bean.WareDTO, property: taxBase,
newValue: 1,newValue class: java.lang.Long method parameter class:
java.math.BigDecimal, argument type mismatch
Or if i input decimal value - 1.5 i get ... newValue: 1.5,newValue class:
java.lang.Double method parameter class: java.math.BigDecimal, argument type
mismatch.
Any suggestions?

Re: Problem with f:convertNumber

Posted by Jeff Bischoff <jb...@klkurz.com>.
Adrian,

As I recall, this f:convertNumber tag was "broken" in order to ensure 
compatibility with the JSF spec. The old convertNumber implementation 
(which automatically converts numbers) was immediately moved to sandbox, 
where you can still use it. If you want to use BigDecimal, use 
s:convertNumber.

[1] http://www.nabble.com/convertNumber-tf1682686.html#a4647327

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

Adrian Mitev wrote:
> Other suggestions? And btw why such problem occured?
> 
> 2006/11/14, Mario Ivankovits <ma...@ops.co.at>:
>>
>> Hi Adrian!
>> > Hi all! I`m using myfaces 1.1.5 nightly build. I've created my own
>> > convertor for BigDecimal to show error message that is oriented to the
>> > big decimal object. I have form with input field that is binded to big
>> > decimal. Everything works fine. Now i want to put a convertor that
>> > will cut some fraction digits - <f:convertNumber maxFractionDigits="5"
>> > />. When the page is rendered everything is ok but when i submit the
>> > form i got the following as <h:message> for the input component:
>> > Exception setting property taxBase of base with class
>> > org.cts.web.bean.WareDTO, Bean: org.cts.web.bean.WareDTO, property:
>> > taxBase, newValue: 1,newValue class: java.lang.Long method parameter
>> > class: java.math.BigDecimal, argument type mismatch
>> > Or if i input decimal value - 1.5 i get ... newValue: 1.5,newValue
>> > class: java.lang.Double method parameter class: java.math.BigDecimal,
>> > argument type mismatch.
>> > Any suggestions?
>> Use the tomahawk sandbox (I think) converter s:convertNumber which will
>> automatically try to convert the input to the data type of your backing
>> bean.
>>
>> Ciao,
>> Mario
>>
>>
> 



Re: Problem with f:convertNumber

Posted by Adrian Mitev <ad...@googlemail.com>.
Other suggestions? And btw why such problem occured?

2006/11/14, Mario Ivankovits <ma...@ops.co.at>:
>
> Hi Adrian!
> > Hi all! I`m using myfaces 1.1.5 nightly build. I've created my own
> > convertor for BigDecimal to show error message that is oriented to the
> > big decimal object. I have form with input field that is binded to big
> > decimal. Everything works fine. Now i want to put a convertor that
> > will cut some fraction digits - <f:convertNumber maxFractionDigits="5"
> > />. When the page is rendered everything is ok but when i submit the
> > form i got the following as <h:message> for the input component:
> > Exception setting property taxBase of base with class
> > org.cts.web.bean.WareDTO, Bean: org.cts.web.bean.WareDTO, property:
> > taxBase, newValue: 1,newValue class: java.lang.Long method parameter
> > class: java.math.BigDecimal, argument type mismatch
> > Or if i input decimal value - 1.5 i get ... newValue: 1.5,newValue
> > class: java.lang.Double method parameter class: java.math.BigDecimal,
> > argument type mismatch.
> > Any suggestions?
> Use the tomahawk sandbox (I think) converter s:convertNumber which will
> automatically try to convert the input to the data type of your backing
> bean.
>
> Ciao,
> Mario
>
>

Re: Problem with f:convertNumber

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi Adrian!
> Hi all! I`m using myfaces 1.1.5 nightly build. I've created my own
> convertor for BigDecimal to show error message that is oriented to the
> big decimal object. I have form with input field that is binded to big
> decimal. Everything works fine. Now i want to put a convertor that
> will cut some fraction digits - <f:convertNumber maxFractionDigits="5"
> />. When the page is rendered everything is ok but when i submit the
> form i got the following as <h:message> for the input component:
> Exception setting property taxBase of base with class
> org.cts.web.bean.WareDTO, Bean: org.cts.web.bean.WareDTO, property:
> taxBase, newValue: 1,newValue class: java.lang.Long method parameter
> class: java.math.BigDecimal, argument type mismatch
> Or if i input decimal value - 1.5 i get ... newValue: 1.5,newValue
> class: java.lang.Double method parameter class: java.math.BigDecimal,
> argument type mismatch.
> Any suggestions?
Use the tomahawk sandbox (I think) converter s:convertNumber which will
automatically try to convert the input to the data type of your backing
bean.

Ciao,
Mario