I am creating a form using the BeanItem class. When I use the following code snippet, my form does not appear:
List<Object> orderedProperties = Arrays.asList(ReflectionUtil.getField("NATURAL_COL_ORDER"));
setItemDataSource(new BeanItem(entity), orderedProperties);
If I use the following code snippet, my form does appear, but the fields from the BeanItem are listed alphabetically and I don’t want them listed alphabetically. I want them listed in the order of “NATURAL_COL_ORDER”.
setVisibleItemProperties((Object[]) ReflectionUtil.getField("NATURAL_COL_ORDER"));
setItemDataSource(new BeanItem(entity));
So, for some reason my application doesn’t like the call to
setItemDataSource(Item datasource, Collection properties)
Any ideas on how to get that call to work or how to reorder the columns using setVisibleItemProperties?