Raam
Raam

Reputation: 29

JSF convertNumber throws java.lang.IllegalArgumentException: argument type mismatch Error

I'm using JSF 1.2. My IDE is RAD.

In my xhtml page Iam using a convertNumber tag to format an Integer variable. Integers need to be left padded with 0's if they are not 4 digits long (If the Integer value is 21, it should be displayed as 0021)

I have used a convertNumber to acheive this.

<f:convertNumber pattern="0000"/>

It looks fine when the values are being displayed, but when i try to input an integer value into the textbox, and try to save it, it throws the following error:

ava.lang.IllegalArgumentException: argument type mismatch

Am I doing something wrong ? Is custom validators the only way to acheive this ?

Upvotes: 0

Views: 1734

Answers (1)

Andrey
Andrey

Reputation: 6766

You can achieve that using <f:convertNumber minIntegerDigits="4"/>.

Upvotes: 1

Related Questions