aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2016-09-07 11:24:44 +0300
committerVaadin Code Review <review@vaadin.com>2016-09-07 09:33:34 +0000
commit34f729bbbd026ae3f6feabc038b0ef0a212183dd (patch)
treedf78d3df48e02075bfdc45580aeeefc2d5309276 /server/src/main/java
parent0857fafb22eff83388ef4d9f208681e16191b190 (diff)
downloadvaadin-framework-34f729bbbd026ae3f6feabc038b0ef0a212183dd.tar.gz
vaadin-framework-34f729bbbd026ae3f6feabc038b0ef0a212183dd.zip
Make sure DataCommunicator always has a DataSource
Change-Id: I8da042e68da1d28bff87965adeee75aa60b6021d
Diffstat (limited to 'server/src/main/java')
-rw-r--r--server/src/main/java/com/vaadin/server/data/DataCommunicator.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/Grid.java6
2 files changed, 3 insertions, 5 deletions
diff --git a/server/src/main/java/com/vaadin/server/data/DataCommunicator.java b/server/src/main/java/com/vaadin/server/data/DataCommunicator.java
index 5aceb9b305..396add585e 100644
--- a/server/src/main/java/com/vaadin/server/data/DataCommunicator.java
+++ b/server/src/main/java/com/vaadin/server/data/DataCommunicator.java
@@ -176,7 +176,7 @@ public class DataCommunicator<T> extends AbstractExtension {
private Collection<DataGenerator<T>> generators = new LinkedHashSet<>();
private ActiveDataHandler handler = new ActiveDataHandler();
- private DataSource<T> dataSource;
+ private DataSource<T> dataSource = DataSource.create();
private DataKeyMapper<T> keyMapper;
private boolean reset = false;
diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java
index 22b5ef8072..1214f34d49 100644
--- a/server/src/main/java/com/vaadin/ui/Grid.java
+++ b/server/src/main/java/com/vaadin/ui/Grid.java
@@ -35,7 +35,6 @@ import com.vaadin.data.selection.SingleSelection;
import com.vaadin.server.AbstractExtension;
import com.vaadin.server.KeyMapper;
import com.vaadin.server.data.DataGenerator;
-import com.vaadin.server.data.DataSource;
import com.vaadin.server.data.SortOrder;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.data.DataCommunicatorConstants;
@@ -586,7 +585,6 @@ public class Grid<T> extends AbstractListing<T, SelectionModel<T>>
*/
public Grid() {
setSelectionModel(new SingleSelection<>(this));
- setDataSource(DataSource.create());
registerRpc(new GridServerRpcImpl());
detailsManager = new DetailsManager<>();
addExtension(detailsManager);
@@ -608,8 +606,8 @@ public class Grid<T> extends AbstractListing<T, SelectionModel<T>>
*
* @return the new column
*/
- public <V> Column<T, V> addColumn(String caption, Function<T, ? extends V> valueProvider,
- Renderer<V> renderer) {
+ public <V> Column<T, V> addColumn(String caption,
+ Function<T, ? extends V> valueProvider, Renderer<V> renderer) {
Column<T, V> c = new Column<>(caption, valueProvider, renderer);
c.extend(this);