diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-04-28 14:26:26 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-04-28 12:53:27 +0000 |
commit | 0897607042fe8da4c20d02ae47d1ac0b326f243d (patch) | |
tree | 253b95436225a902d36afc164f2be5112025a71b /client | |
parent | 813559e82a8093bd21fb0399f3d9b1654472e466 (diff) | |
download | vaadin-framework-0897607042fe8da4c20d02ae47d1ac0b326f243d.tar.gz vaadin-framework-0897607042fe8da4c20d02ae47d1ac0b326f243d.zip |
Fix ComboBox cleared suggestion popup on ItemSetChange (#13635)
Change-Id: I77285e17819daf1b8328a8aea6d62a6b6b53510c
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java | 11 |
1 files changed, 8 insertions, 3 deletions
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); |