Grid editor gives "The item xxxx is not in the backing data provider" after adding row to ListDataProvider

I have a Grid with a ListDataProvider.
If Grid has many rows, adding a new row at the end, and editing it, gives:

 java.lang.IllegalStateException: The item xxxx is not in the backing data provider
    at deployment.ptsmc.ear//com.vaadin.flow.component.grid.editor.EditorImpl.validate(
    at deployment.ptsmc.ear//com.vaadin.flow.component.grid.editor.EditorImpl.requestEditItem(
    at deployment.ptsmc.ear//com.vaadin.flow.component.grid.editor.EditorImpl.lambda$editItem$2d5ea2ce$1(
    at deployment.ptsmc.ear//com.vaadin.flow.internal.StateTree.lambda$runExecutionsBeforeClientResponse$2(
    at java.base/$ForEachOp$OfRef.accept(
    at java.base/$2$1.accept(
    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(
    at java.base/
    at java.base/
    at java.base/$ForEachOp.evaluateSequential(
    at java.base/$ForEachOp$OfRef.evaluateSequential(
    at java.base/
    at java.base/
    at deployment.ptsmc.ear//com.vaadin.flow.internal.StateTree.runExecutionsBeforeClientResponse(
    at deployment.ptsmc.ear//com.vaadin.flow.server.communication.UidlWriter.encodeChanges(
    at deployment.ptsmc.ear//com.vaadin.flow.server.communication.UidlWriter.createUidl(
    at deployment.ptsmc.ear//com.vaadin.flow.server.communication.UidlRequestHandler.createUidl(
    at deployment.ptsmc.ear//com.vaadin.flow.server.communication.UidlRequestHandler.writeUidl(
    at deployment.ptsmc.ear//com.vaadin.flow.server.communication.UidlRequestHandler.synchronizedHandleRequest(
    at deployment.ptsmc.ear//com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(
    at deployment.ptsmc.ear//com.vaadin.flow.server.VaadinService.handleRequest(
    at deployment.ptsmc.ear//com.vaadin.flow.server.VaadinServlet.service(

I add row to the collection behind ListDataProvider, call ListDataProvider.refreshAll(), then open the editor on the new row.

If I start out with fewer rows in ListDataProvider, it works just fine. <20 works fine. >200 gives error.
If I insert the row at the start, it also works fine.

So, looks like a bug, but just wondered if anyone had a workaround

My first guess is that there is something wrong with object identity.

1 Like

You are not talking about implementing equals/hashCode I hope?
I don’t override those, so the only object a row is equal to is its own instance.
Just to be sure I did try adding a unique id and equals to the example below, but nothing changed.

Here is an example.
With 50 rows it fails.
With 49 rows it works.
( Vaadin 24.3.12, WIndows 10, Firefox 126.0.1 )

public class TestGridInsert extends VerticalLayout {

    public static class Row {

        String name;

        Row(String name) {
   = name;

        public String getName() {
            return name;

        public void setName(String name) {
   = name;


    public TestGridInsert() {

        // Data

        var rows = new ArrayList<Row>();

        for(int i=0; i<50; i++) {
            rows.add(new Row("John Doe " + i));

        // Grid with editor

        var grid = new Grid<Row>(rows);
        var namecol = grid.addColumn(Row::getName).setHeader("Name");

        var binder = new Binder<>(Row.class);
        var editor = grid.getEditor();

        TextField nameField = new TextField();

                .bind(Row::getName, Row::setName);

        // Button to add new row

        var addRowButton = new Button("Add", event -> {
            var newRow = new Row("Jane Doe");


        add(addRowButton, grid);



Registered bug:

It could be a corner case bug, thanks for reporting. 50 is the default page size of the Grid. So if you have 50 rows there and add 51st row and call to open the Editor, the Grid should fetch the next page of items from the server (one row in this case) and open it for editing. Something goes wrong, which needs more debugging.