Browse Source

Fix for #5556 - Client Side Caching of Stale Data in Select Component

svn changeset:14915/svn branch:6.4
tags/6.7.0.beta1
Artur Signell 13 years ago
parent
commit
7c2e023968
1 changed files with 14 additions and 0 deletions
  1. 14
    0
      src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java

+ 14
- 0
src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java View File

@@ -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");


Loading…
Cancel
Save