I am using Vaadin 8 for Tabular data representation with dynamic bean. so i have to define logical filter on column.
For that i need column datatype from grid or column object. Is there any way to get data types of column?
In Vaadin 7 i can get using container.getType(columnName)
In the Vaadin 8 data binding model, the property type is not explicitly known by the UI component (in your case Grid
). This information should come from your domain model.
If difficult to retrieve from your domain model, you can do:
// instead of new Grid(beanType)
PropertySet<YourBeanType> ps = BeanPropertySet.get(beanType);
Grid g = new Grid(ps);
...
// get the property type
// okay, this is ugly, but you get the idea
Class<?> type = ps.getProperty(yourPropertyName).get().getType();