I have an InputText
component wired to a Bean property of int type.
However, I'm forced to use NumberConverter
only
Even when I specify integerOnly = true
, it accepts doubles by removing the fractional part and no error is thrown in Validation phase
My question is, is there a way for NumberConverter
to throw conversion exception and error message (preferably client side, I mean, when I tab out of the field)
We are using JSF 1.2
(Actually, NumberConverter's getAsObject() has this code which should be throwing exception when converting from BigDecimal to Integer when there is a loss of precision
GenericConverterFactory fac = GenericConverterFactory .getCurrentInstance();
try
{
value = fac.convert(value, expectedType);
}
)