From 7c2e0239686f10c7a0c808ce3494bcf4074d6fe7 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 14 Sep 2010 15:50:34 +0000 Subject: [PATCH] Fix for #5556 - Client Side Caching of Stale Data in Select Component svn changeset:14915/svn branch:6.4 --- .../terminal/gwt/client/ui/VFilterSelect.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java index cb99bc590d..bca8b55854 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java @@ -751,6 +751,10 @@ public class VFilterSelect extends Composite implements Paintable, Field, private int currentPage; + /** + * A collection of available suggestions (options) as received from the + * server. + */ private final Collection currentSuggestions = new ArrayList(); private boolean immediate; @@ -765,6 +769,10 @@ public class VFilterSelect extends Composite implements Paintable, Field, private String lastFilter = ""; private int lastIndex = -1; // last selected index when using arrows + /** + * The current suggestion selected from the dropdown. This must be one of + * the values in currentSuggestions (I think..). + */ private FilterSelectSuggestion currentSuggestion; private int totalMatches; @@ -958,7 +966,13 @@ public class VFilterSelect extends Composite implements Paintable, Field, allowNewItem = uidl.hasAttribute("allownewitem"); lastNewItemString = null; + /* + * Clear the current suggestions as the server response always includes + * the new ones. + */ currentSuggestions.clear(); + currentSuggestion = null; + final UIDL options = uidl.getChildUIDL(0); totalMatches = uidl.getIntAttribute("totalMatches"); -- 2.39.5