Hi guys,
I noticed the changes in the way of creating forms in Vaadin 7 and think they are very positive.
There’s only one nice thing that was working great before and that I can’t seem to replicate anymore. I have a big set of JPA entities and need to create some generic forms for editing them.
I have been able to create the generic forms with FieldGroup and binding it with a BeanItem. The code I am using basically is:
BeanItem<EntityInterface> entityBean = new BeanItem<EntityInterface>(entity);
fieldGroup.setItemDataSource(entityBean);
for (Object property : fieldGroup.getUnboundPropertyIds()) {
Field field = fieldGroup.buildAndBind(property);
field.setWidth(100, Unit.PERCENTAGE);
panel.addComponent(field);
}
Before I was simply linking the form to the BeanItem. The result is almost identical, only that some of the methods in the JPA entities have private setters. When this happened with the old Form system, the fields binded to the private setters would display the content but would not be enabled for editing.
Any ideas on about how can I replicate this behaviour in Vaadin 7?
Thank you in advance!