Grid with Editor can't save changed data

I implemented a vaadin grid in buffered mode with a simple client pojo, it is pretty much the same as in the vaadin examples for buffered mode. Everything is ok, beside that saving is not possible when I try to change something in the edited fields. As soon as I change something, the save button and the editor will get stuck. All other things do as expected.

@Route(value = "")
public class ClientView extends VerticalLayout {

    private final Logger LOGGER = LoggerFactory.getLogger(ClientView.class);
    private List<Client> clientArrayList = new ArrayList<>();
    private Grid<Client> grid = new Grid<>();

    public ClientView() {"init clientview");

        // test data
        clientArrayList.add(new Client("tenant1", "client1", "name client1", "server1"));
        clientArrayList.add(new Client("tenant1", "client2", "name client2", "server1"));
        clientArrayList.add(new Client("tenant2", "client3", "name client3", "server1"));
        clientArrayList.add(new Client("tenant2", "client4", "name client4", "server1"));

        // button add new element
        final Button btnAdd = new Button("Neue Einheit");

        // build grid
        final Grid.Column<Client> colClientId = grid.addColumn(Client::getClientId).setHeader("Kennung").setAutoWidth(true).setSortable(true);
        final Grid.Column<Client> colClientName = grid.addColumn(Client::getClientName).setHeader("Name der Einheit").setAutoWidth(true).setSortable(true);
        final Grid.Column<Client> colClientServerUrl = grid.addColumn(Client::getClientServerUrl).setHeader("Url zum Server").setAutoWidth(true).setSortable(true);

        // editing fields
        final Binder<Client> binder = new Binder<>(Client.class);
        final Editor<Client> editor = grid.getEditor();

        // all three editing fields
        final TextField tfClientId = new TextField();
                .withValidator(value -> (value.length() > 0),"Kennung muss einen Wert enthalten").bind("clientId");

        final TextField tfClientName = new TextField();
        tfClientName.setPlaceholder("Name der Einheit");
                .withValidator(value -> (value.length() > 0), "Name muss einen Wert enthalten").bind("clientName");

        final TextField tfClientServerUrl = new TextField();

        // add editor column
        final Collection<Button> editButtons = Collections.newSetFromMap(new WeakHashMap<>());
        final Grid.Column<Client> editorColumn = grid.addComponentColumn(client -> {
            final Button edit = new Button("Ändern");
            edit.addClickListener(event -> {
      "editor click");
            final Button delete = new Button("Löschen");
            delete.addClickListener(event -> {
                try {
                } catch (Exception e) {
          "Die geänderte Einheit konnte nicht gespeichert werden!", 8000, Notification.Position.TOP_END);
      "delete click");
            final Div outsideEditor = new Div(edit, delete);
            return outsideEditor;

        // editor open listener
        editor.addOpenListener(event -> {
   -> button.setEnabled(!editor.isOpen()));

        // editor close listener
        editor.addCloseListener(event -> {
   -> button.setEnabled(!editor.isOpen()));

        // buttons for inside editor-mode
        final Button save = new Button("Speichern", e -> {

        final Button cancel = new Button("Abbrechen", e -> {

        final Div insideEditor = new Div(cancel, save);
        insideEditor.add(cancel, save);

        grid.getElement().addEventListener("keyup", event -> editor.cancel()).setFilter("event.key === 'Escape' || event.key === 'Esc'");

        // editor save listener
        editor.addSaveListener(event -> {
            final Client client = event.getItem();

        // editor cancel listener
        editor.addCancelListener(event -> {

        // add a new client into list and edit that
        btnAdd.addClickListener(event -> {
  "add click listener");
            Client client = null;
            try {
                client = new Client("test", "", "", "");
            } catch (Exception e) {
      "Die neue Einheit konnte nicht gespeichert werden!", 8000, Notification.Position.TOP_END);

        // sets the max number of items to be rendered on the grid for each page

        add(grid);"finish clientview");

    private void reload() {

    private void delete(final Client client) {
        // TODO

    private void save(final Client client) {
        // TODO

The client pojo is a simple class

public class Client implements Serializable {
    private String tenantId;
    private String clientId;
    private String clientName;
    private String clientServerUrl;
	... all getters & setter & equals & hashcode & toString

I used a standard generated maven pom for vaadin with version 17.0.6 and deployed it to jetty to test on localhost.

What have I missed - I searched all available samples in the free world, but I didn’t see the hint, what I have to do??? Could you please give me a hint? Thanks!

I have the exact same issue after 4 years and with vaadin 14.

Same issue, Vaadin 14. Save, Cancel buttons (and other editor fields) don’t close after change any field and saving in buffered editor.
If i pressing Save or Cancel without editing fields, editor close as normal.

I was struggling with this problem too and finally it turned out that the EqualsAndHaschCode was not set correctly or not set at all for the object. So adding @EqualsAndHashCode(of = “my-property”) solved my problem (using lombok).

I hope this answer can helps someone of you guys.

Ok, I experimented with equals/hashCode.
I found that the editor works fine WITHOUT equals/hashCode methods.
When I generate methods manually or using Lombok - the editor does not close as described above.
Strange behavior…

When I generate methods manually or using Lombok

The generated methods by Lombok include the whole bean content, thus the identity of the bean changes when you edit it and thus item to be refreshed from DataProvider is not found.

If you want to use equals/hashCode as defined by Lombok, you need to extend DataProvider yourself and override getId() method there, the default implementation returns item itself as id. As you know the Bean, you can use some Bean#getId() as better invariant id of the bean.

 * Gets an identifier for the given item. This identifier is used by the
 * framework to determine equality between two items.
 * <p>
 * Default is to use item itself as its own identifier. If the item has
 * {@link Object#equals(Object)} and {@link Object#hashCode()} implemented
 * in a way that it can be compared to other items, no changes are required.
 * <p>
 * <strong>Note:</strong> This method will be called often by the Framework.
 * It should not do any expensive operations.
 * @param item
 *            the item to get identifier for; not {@code null}
 * @return the identifier for given item; not {@code null}
default Object getId(T item) {
	Objects.requireNonNull(item, "Cannot provide an id for a null item.");
	return item;

Thank you! Now it works fine.

  public int hashCode() {
    if (getId() != null) {
      return getId().hashCode();
    return super.hashCode();

  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    if (obj == null) {
      return false;
    if (getClass() != obj.getClass()) {
      return false;
    AbstractEntity other = (AbstractEntity) obj;
 if (getId() == null || other.getId() == null) {
      return false;
    return getId().equals(other.getId());