From 29f7c2dc647df242dfa100340e23f98637e612bf Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Wed, 30 Jun 2010 20:31:08 +0000 Subject: [PATCH] fixes #810, #4607,#5279, #5281 all selects now reset value on container changes. The approach has been used in table previously reverted an invalid fix from VFilterSelect svn changeset:13980/svn branch:6.4 --- src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java | 1 - src/com/vaadin/ui/AbstractSelect.java | 7 +++++++ src/com/vaadin/ui/Table.java | 4 ---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java index ed9acb6684..f51a2e5120 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java @@ -962,7 +962,6 @@ public class VFilterSelect extends Composite implements Paintable, Field, lastNewItemString = null; currentSuggestions.clear(); - currentSuggestion = null; final UIDL options = uidl.getChildUIDL(0); totalMatches = uidl.getIntAttribute("totalMatches"); diff --git a/src/com/vaadin/ui/AbstractSelect.java b/src/com/vaadin/ui/AbstractSelect.java index 60dfea0da2..30842dae2d 100644 --- a/src/com/vaadin/ui/AbstractSelect.java +++ b/src/com/vaadin/ui/AbstractSelect.java @@ -901,7 +901,14 @@ public abstract class AbstractSelect extends AbstractField implements } } + /* + * We expect changing the data source should also clean value. See + * #810, #4607, #5281 + */ + setValue(null); + requestRepaint(); + } } diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index 031935cc70..e45570e239 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -1846,10 +1846,6 @@ public class Table extends AbstractSelect implements Action.Container, setVisibleColumns(col.toArray()); - // null value as we may not be sure that currently selected identifier - // exits in new ds - setValue(null); - // Assure visual refresh resetPageBuffer(); -- 2.39.5