[jboss-user] [JBoss Seam] - f:converter and maxdigits

nemya do-not-reply at jboss.com
Tue Sep 4 11:56:54 EDT 2007


Hi,
I have an inputtext for a float value. I added the converter to have this:
<h:inputText value="#{MyBean.MyValue}">
  | 	<f:converter converterId="javax.faces.Float" />
  | </h:inputText>

This works fine but I'd like this float value to be displayed with 2 fraction digits. I know that the  <f:convertNumber> with the maxFractionDigits and minFractionDigits does this but when I use it like this :
<h:inputText value="#{MyBean.MyValue}">
  |  	<f:converter converterId="javax.faces.Float" />
  |         <f:convertNumber minFractionDigits="2" maxFractionDigits="2"/>
  | </h:inputText>

I have a cast exception 
java.lang.ClassCastException: java.lang.Double

And when I use it like this:
<h:inputText value="#{MyBean.MyValue}">
  |         <f:convertNumber minFractionDigits="2" maxFractionDigits="2"/>
  |  	<f:converter converterId="javax.faces.Float" />
  | </h:inputText>

I have no problem but I don't have 2 fraction digits.

Some help please! (using Jboss Seam 1.2.1.GA + Jboss AS 4.0.5.GA)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080962#4080962

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080962



More information about the jboss-user mailing list