From 0897607042fe8da4c20d02ae47d1ac0b326f243d Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Mon, 28 Apr 2014 14:26:26 +0300 Subject: Fix ComboBox cleared suggestion popup on ItemSetChange (#13635) Change-Id: I77285e17819daf1b8328a8aea6d62a6b6b53510c --- .../src/com/vaadin/client/ui/combobox/ComboBoxConnector.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'client') diff --git a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java index 8dec26cf90..bc28a01c0c 100644 --- a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java +++ b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java @@ -121,6 +121,10 @@ public class ComboBoxConnector extends AbstractFieldConnector implements boolean suggestionsChanged = !getWidget().initDone || !newSuggestions.equals(getWidget().currentSuggestions); + // An ItemSetChangeEvent on server side clears the current suggestion + // popup. Popup needs to be repopulated with suggestions from UIDL. + boolean popupOpenAndCleared = false; + oldSuggestionTextMatchTheOldSelection = false; if (suggestionsChanged) { @@ -141,6 +145,7 @@ public class ComboBoxConnector extends AbstractFieldConnector implements * menu might not necessary exist in select at all anymore. */ getWidget().suggestionPopup.menu.clearItems(); + popupOpenAndCleared = getWidget().suggestionPopup.isAttached(); } @@ -159,9 +164,9 @@ public class ComboBoxConnector extends AbstractFieldConnector implements } } - if (getWidget().waitingForFilteringResponse - && getWidget().lastFilter.toLowerCase().equals( - uidl.getStringVariable("filter"))) { + if ((getWidget().waitingForFilteringResponse && getWidget().lastFilter + .toLowerCase().equals(uidl.getStringVariable("filter"))) + || popupOpenAndCleared) { getWidget().suggestionPopup.showSuggestions( getWidget().currentSuggestions, getWidget().currentPage, getWidget().totalMatches); -- cgit v1.2.3