summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2010-09-14 15:50:34 +0000
committerArtur Signell <artur.signell@itmill.com>2010-09-14 15:50:34 +0000
commit7c2e0239686f10c7a0c808ce3494bcf4074d6fe7 (patch)
treeb56e73085cc6bffffb0dba35d16dc96b004ba4b0 /src
parent9c51ceaa9b56ab1d6e30af3ff32786fea5dc8586 (diff)
downloadvaadin-framework-7c2e0239686f10c7a0c808ce3494bcf4074d6fe7.tar.gz
vaadin-framework-7c2e0239686f10c7a0c808ce3494bcf4074d6fe7.zip
Fix for #5556 - Client Side Caching of Stale Data in Select Component
svn changeset:14915/svn branch:6.4
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java14
1 files changed, 14 insertions, 0 deletions
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<FilterSelectSuggestion> currentSuggestions = new ArrayList<FilterSelectSuggestion>();
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");