users@javaserverfaces.java.net

Problem with f:convertNumber

From: Dave Syer <david_syer_at_hotmail.com>
Date: Thu, 2 Nov 2006 00:56:03 -0800 (PST)

This problem came to light on the facelets forum
(http://www.nabble.com/Problem-using-f%3AconvertNumber-tf2551103.html), but
it looks like it's actually an issue only with the JSF RI. I have only
tried version 1.1 (1.1_02-b08), but it looks like an
IllegalArgumentException is wrongly thrown deep in the el library, and then
is caught and converted to a conversion error by ViewHandlerImpl. This
happens even with perfectly valid input, so in fact there should be no
conversion error.

Example:

<h:inputText id="value" value="#{bean.value}">
      <f:convertNumber pattern="#"/>
  </h:inputText>

Even if the user enters a valid number there is a conversion error, which I
tracked using a debugger to an IllegalArgumentException in the el-ri (which
I have no source code for) in ValueExpressionImpl.setValue. It doesn't
matter what parameters I put in the convertNumber, I always get an error -
e.g. even with a minIntegerDigits instead of a pattern.

The same code works with myfaces.
-- 
View this message in context: http://www.nabble.com/Problem-with-f%3AconvertNumber-tf2558498.html#a7129882
Sent from the javaserverfaces users mailing list archive at Nabble.com.