From 4aac5294bba6eff216cddaa826b7739494376ff7 Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Tue, 13 Sep 2016 13:29:00 +0300 Subject: Use state for ComboBox selection Change-Id: I612376b4030a750c987ba2d8016a4dc44bc02d41 --- server/src/main/java/com/vaadin/ui/ComboBox.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'server/src/main/java') diff --git a/server/src/main/java/com/vaadin/ui/ComboBox.java b/server/src/main/java/com/vaadin/ui/ComboBox.java index 39c2bad8ba..8fdc8452ed 100644 --- a/server/src/main/java/com/vaadin/ui/ComboBox.java +++ b/server/src/main/java/com/vaadin/ui/ComboBox.java @@ -38,7 +38,6 @@ import com.vaadin.server.data.DataKeyMapper; import com.vaadin.server.data.DataSource; import com.vaadin.shared.Registration; import com.vaadin.shared.data.DataCommunicatorConstants; -import com.vaadin.shared.ui.combobox.ComboBoxClientRpc; import com.vaadin.shared.ui.combobox.ComboBoxConstants; import com.vaadin.shared.ui.combobox.ComboBoxServerRpc; import com.vaadin.shared.ui.combobox.ComboBoxState; @@ -70,9 +69,7 @@ public class ComboBox extends AbstractSingleSelect implements HasValue, if (value != null) { selectedCaption = getItemCaptionProvider().apply(value); } - // FIXME now overlap between state and RPC - getRpcProxy(ComboBoxClientRpc.class).setSelectedItem(key, - selectedCaption); + getState().selectedItemCaption = selectedCaption; } } @@ -150,16 +147,6 @@ public class ComboBox extends AbstractSingleSelect implements HasValue, } } - @Override - public void setSelectedItem(String key) { - // it seems both of these happen, and mean empty selection... - if (key == null || "".equals(key)) { - getSelectionModel().setSelectedFromClient(null); - } else { - getSelectionModel().setSelectedFromClient(key); - } - } - @Override public void setFilter(String filterText) { filterstring = filterText; -- cgit v1.2.3