Hi I am using lazyquerycontainer integrated with jpa. As the entity manager loads the data some fields are in bigdecimal format but I want to show in date format. In the filtertable I have defined a decorator also but the format it is displaying is like 20,010,130. Is it something I can do in the table itself? Please help Thank you.
Asked
Active
Viewed 85 times
1 Answers
0
If I have understood you correctly, tables can be overridden to do what you need:
Table t = new Table() {
@Override
protected String formatPropertyValue(Object rowId, Object colId,
Property property) {
Object v = property.getValue();
if (v instanceof Date) {
Date dateValue = (Date) v;
return "Formatted date: " + (1900 + dateValue.getYear())
+ "-" + dateValue.getMonth() + "-"
+ dateValue.getDate();
}
return super.formatPropertyValue(rowId, colId, property);
}
};
example from vaadin forum

Yampeku
- 583
- 1
- 4
- 21
-
I have already overridden this method and I have also given formatting for the table but still I am getting the same result – Ajay Shankar R Aug 04 '15 at 12:16
-
Strange, you can always make the condition not on the value but depending on the rowID. In fact you should try to assign a constant first to be sure if it is working or not. As an additional note, if you are able you should try the grids. They are receiving much more support and these kinds of things are far more easy to achieve. – Yampeku Aug 04 '15 at 14:50