Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
How to edit and apply changes to beans with Grid component?
I am new to Vaadin. I like to use the Grid component to edit a list of beans. When I edit in cell the value the changes get not applied to my beans. So what I missing here
@Override
protected void init(VaadinRequest request) {
... VerticalLayout layout = new VerticalLayout();
PersonDAO personDAO = (PersonDAO) context.getBean("personDAO");
List<Person> personList = personDAO.getPerson();
BeanItemContainer<Person> ds = new BeanItemContainer<Person>(Person.class, personList);
Grid grid = new Grid("Person",ds);
grid.setEditorEnabled(true);
setContent(layout);
Thank you.
I found the problem. I am using for my Bean "Lombok" which generates automatically the Setter, Getters, Equals and HashCode in Bytecode. If I remove the @Data annotation of Lombok and just use @Gettes and @Setter it works. It looks like that with the Generated Equals or HashCode Method from Lombok it does not work. Others seems to have similar problems - link. Does somebody experience same problems with Lombok and Vaadin?
When I reduce the equals and hashcode method to use just the "id" it works with Lombok.
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(of={"id"})
public class Person {
public Person() {}
public Person(int id, String name) {
this.id = id;
this.name = name;
}
private int id;
private String name;
}