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"/>
.
精彩评论