Fixes #9944tags/8.2.0.alpha2
@@ -2277,7 +2277,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, | |||
* @since 8.0.7 | |||
*/ | |||
protected Grid(Class<T> beanType, DataCommunicator<T> dataCommunicator) { | |||
this(BeanPropertySet.get(beanType)); | |||
this(BeanPropertySet.get(beanType), dataCommunicator); | |||
this.beanType = beanType; | |||
} | |||
@@ -23,6 +23,7 @@ import java.util.concurrent.atomic.AtomicReference; | |||
import java.util.stream.Collectors; | |||
import java.util.stream.Stream; | |||
import com.vaadin.data.provider.DataCommunicator; | |||
import org.easymock.Capture; | |||
import org.junit.Assert; | |||
import org.junit.Before; | |||
@@ -70,6 +71,15 @@ public class GridTest { | |||
.setId("randomColumnId"); | |||
} | |||
@Test | |||
public void testCreateGridWithDataCommunicator() { | |||
DataCommunicator specificDataCommunicator = new DataCommunicator<>(); | |||
TestGrid<String> grid = new TestGrid(String.class, specificDataCommunicator); | |||
assertEquals(specificDataCommunicator, grid.getDataCommunicator()); | |||
} | |||
@Test | |||
public void testGridHeightModeChange() { | |||
assertEquals("Initial height mode was not CSS", HeightMode.CSS, |
@@ -0,0 +1,17 @@ | |||
package com.vaadin.tests.server.component.grid; | |||
import com.vaadin.data.provider.DataCommunicator; | |||
import com.vaadin.ui.Grid; | |||
/** | |||
* {@link Grid} class for testing purposes | |||
* @param <T> | |||
* the grid bean type | |||
*/ | |||
public class TestGrid<T> extends Grid<T> { | |||
public TestGrid(Class<T> beanType, DataCommunicator<T> dataCommunicator) { | |||
super(beanType, dataCommunicator); | |||
} | |||
} |