开发者

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 err开发者_StackOverflowor:

ava.lang.IllegalArgumentException: argument type mismatch

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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜