[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2308) model validation failed:java.lang.Double
Milan Vidakovic (JIRA)
jira-events at lists.jboss.org
Wed Nov 28 06:16:47 EST 2007
model validation failed:java.lang.Double
----------------------------------------
Key: JBSEAM-2308
URL: http://jira.jboss.com/jira/browse/JBSEAM-2308
Project: JBoss Seam
Issue Type: Bug
Components: Core
Affects Versions: 1.2.1.GA
Environment: RedHat Developer Studio Beta2
Reporter: Milan Vidakovic
I have a double attribute in my entity. I have a form which submits data. If I have <s:validateAll> tag around my form, I cannot submit data and get a following message:
model validation failed:java.lang.Double
However, if I remove the <s:validateAll> tag from the form, it submits data correctly. The form displays data correctly in both cases.
Here is the xhtml page snippet:
<h:outputLabel value="Name: " for="prodName" />
<h:inputText id="prodName" value="#{productManager.selectedProduct.name}" disabled="#{productManager.mode=='browse'}" required="true"/>
<h:outputLabel value="Price: " for="prodPrice" />
<h:inputText immediate="true" id="prodPrice" value="#{productManager.selectedProduct.price}" disabled="#{productManager.mode=='browse'}" required="true"/>
<a4j:commandButton action="#{productManager.update}" value="Update" disabled="#{productManager.mode != 'edit'}" reRender="forma"/>
Here is the Entity:
@Entity
@Name("product")
@Scope(ScopeType.EVENT)
public class Product implements Serializable {
private static final long serialVersionUID = 9135130737929566839L;
int id;
String name;
double price;
public Product() {
id = -1;
}
public Product(String name, double price) {
this.name = name;
this.price = price;
}
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@NotNull
@NotEmpty
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@NotNull(message="Morate uneti broj!")
@NotEmpty(message="Morate uneti broj!")
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
@Override
public String toString() {
return "[Product] name: " + name +", price: " + price;
}
}
Validation for the double field simply fails if I add <s:validateAll> tag around the form. I have tried with BigDecimal and the same thing happens. All other data types (String, date, etc.) work correctly.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list