Hello,
In my Vaadin 7 project, I have something very like the below code ( note the simplicity of it ):
[code]
public class FakeClass {
protected final TextField description = new TextField(“Description”);
private final TextField revision = new TextField(“Revision”);
private final FormCheckBox consignment = new FormCheckBox(“Consignment”);
protected final ComboBox notificationPreference = new ComboBox(“Notification Preference”);
public FakeClass() {
description.setNullRepresentation("");
description.setReadOnly(true);
description.setMaxLength(45);
description.addStyleName("partDescription");
revision.setNullRepresentation("");
revision.setReadOnly(true);
// Setup notificationPreference dropdown - not important to my question, so removed
FormLayout form1 = new FormLayout();
form1.addComponents( description, revision, notificationPreference, consignment );
}
public void setData( FakeBean data )
{
fieldGroup = BeanFieldGroup.bindFieldsUnbuffered(data, this);
}
}
[/code]Most of the Vaadin 7 documentation for some reason uses a much more complex method, but this method was used a lit inf a demo program Vaadin provided, and it worked well for me, so I used it. Of special interest is that in the simplest case, the FormCheckBox, I only had to create the field, I did not have to do anything else to get it to bind to the corresponding value in data bean. From what I have seen of the Vaadin 8 documentation, it does not offer such simplicity, such a short solution for such a simple case. Am I missing something?
I have a LOT of code like this, so trying to see if I can simplify the conversion from Vaadin 7 to 8 somehow.