import com.vaadin.shared.ui.grid.GridStaticCellType;
import com.vaadin.shared.ui.grid.HeightMode;
import com.vaadin.shared.ui.grid.SectionState;
+import com.vaadin.ui.Grid.SelectionMode;
import com.vaadin.ui.components.grid.ColumnReorderListener;
import com.vaadin.ui.components.grid.ColumnResizeListener;
import com.vaadin.ui.components.grid.ColumnVisibilityChangeListener;
List<T> items = new ArrayList<>();
for (Element row : body.children()) {
T item = deserializeDeclarativeRepresentation(row.attr("item"));
+ items.add(item);
if (row.hasAttr("selected")) {
getSelectionModel().select(item);
}
import com.vaadin.data.SelectionModel.Multi;
import com.vaadin.data.SelectionModel.Single;
import com.vaadin.data.provider.DataProvider;
+import com.vaadin.data.provider.Query;
import com.vaadin.shared.ui.grid.HeightMode;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.data.bean.Person;
person2.getFirstName(), person2.getLastName(),
getComponentTag());
- testRead(design, grid);
+ Grid<?> readGrid = testRead(design, grid, true, true);
+ Assert.assertEquals(2, readGrid.getDataProvider().size(new Query<>()));
testWrite(design, grid, true);
}
person3.toString(), person3.getFirstName(),
person3.getLastName(), getComponentTag());
- testRead(design, grid);
+ Grid<?> readGrid = testRead(design, grid, true, true);
+ Assert.assertEquals(3, readGrid.getDataProvider().size(new Query<>()));
testWrite(design, grid, true);
}
person2.getFirstName(), person2.getLastName(),
getComponentTag());
- testRead(design, grid);
+ Grid<?> readGrid = testRead(design, grid, true, true);
+ Assert.assertEquals(2, readGrid.getDataProvider().size(new Query<>()));
testWrite(design, grid, true);
}
person2.toString(), person2.getFirstName(),
person2.getLastName(), getComponentTag());
- testRead(design, grid);
+ Grid<?> readGrid = testRead(design, grid, true, true);
+ Assert.assertEquals(2, readGrid.getDataProvider().size(new Query<>()));
testWrite(design, grid, true);
grid.setSelectionMode(SelectionMode.SINGLE);
person2.getFirstName(), person2.getLastName(),
getComponentTag());
- testRead(design, grid);
+ readGrid = testRead(design, grid, true, true);
+ Assert.assertEquals(2, readGrid.getDataProvider().size(new Query<>()));
testWrite(design, grid, true);
}