trouble using converternumber
ajanz Mar 21, 2009 12:25 AMi try to use a converternumber for an inputtext. if i use the primitive datatype double and not Double everything is ok, but i can't assign null values...
page is
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:s="http://jboss.com/products/seam/taglib">
<a4j:form>
<rich:panel>
<rich:messages id="messages" />
<br/>
<h:outputLabel value="TEST 5.3.2009 14:45" for="" />
<h:panelGrid columns="4">
<h:outputLabel value="Betrag" for="" />
<h:inputText value="#{WorkflowPage.double1}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" maxIntegerDigits="10" minIntegerDigits="1"
groupingUsed="true"
/>
</h:inputText>
<h:outputLabel value="Feld2" for="" />
<h:inputText value="#{WorkflowPage.text2}" />
<h:outputLabel value="Feld3" for="" />
<rich:comboBox value="#{WorkflowPage.text3}" disabled="#{WorkflowPage.disable}">
<f:selectItem itemValue="1" itemLabel="1" />
<f:selectItem itemValue="2" itemLabel="2" />
<f:selectItem itemValue="3" itemLabel="3" />
</rich:comboBox>
<h:outputLabel value="Feld4" for="" />
<h:inputText value="#{WorkflowPage.text4}" style="align:left" />
<h:outputLabel value="Feld5" for="" />
<rich:comboBox value="#{WorkflowPage.text5}" >
<f:selectItem itemValue="A" itemLabel="A" />
<f:selectItem itemValue="B" itemLabel="B" />
<f:selectItem itemValue="C" itemLabel="C" />
</rich:comboBox>
</h:panelGrid>
<h:commandButton value="Submit" ></h:commandButton>
</rich:panel>
</a4j:form>
</html>
bean code
Double double1;
public Double getDouble1() {
return double1;
}
public void setDouble1(Double double1) {
this.double1 = double1;
}
where is the problem?
page is
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:s="http://jboss.com/products/seam/taglib">
<a4j:form>
<rich:panel>
<rich:messages id="messages" />
<br/>
<h:outputLabel value="TEST 5.3.2009 14:45" for="" />
<h:panelGrid columns="4">
<h:outputLabel value="Betrag" for="" />
<h:inputText value="#{WorkflowPage.double1}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" maxIntegerDigits="10" minIntegerDigits="1"
groupingUsed="true"
/>
</h:inputText>
<h:outputLabel value="Feld2" for="" />
<h:inputText value="#{WorkflowPage.text2}" />
<h:outputLabel value="Feld3" for="" />
<rich:comboBox value="#{WorkflowPage.text3}" disabled="#{WorkflowPage.disable}">
<f:selectItem itemValue="1" itemLabel="1" />
<f:selectItem itemValue="2" itemLabel="2" />
<f:selectItem itemValue="3" itemLabel="3" />
</rich:comboBox>
<h:outputLabel value="Feld4" for="" />
<h:inputText value="#{WorkflowPage.text4}" style="align:left" />
<h:outputLabel value="Feld5" for="" />
<rich:comboBox value="#{WorkflowPage.text5}" >
<f:selectItem itemValue="A" itemLabel="A" />
<f:selectItem itemValue="B" itemLabel="B" />
<f:selectItem itemValue="C" itemLabel="C" />
</rich:comboBox>
</h:panelGrid>
<h:commandButton value="Submit" ></h:commandButton>
</rich:panel>
</a4j:form>
</html>
bean code
Double double1;
public Double getDouble1() {
return double1;
}
public void setDouble1(Double double1) {
this.double1 = double1;
}
where is the problem?