]> source.dussan.org Git - vaadin-framework.git/commitdiff
Only update value on locale change if using the data source directly (#8192) 19/519/1
authorArtur Signell <artur@vaadin.com>
Mon, 17 Dec 2012 19:16:54 +0000 (21:16 +0200)
committerArtur Signell <artur@vaadin.com>
Mon, 17 Dec 2012 19:16:54 +0000 (21:16 +0200)
Change-Id: I8bbf8f693ccb2646df898433897425de7898966f

server/src/com/vaadin/ui/AbstractField.java

index 59e986cd2328ee49a7a37a6e81e252dd0087aa7b..9cf72a36b3bd57d69c0741ac20a697c0c3f5af84 100644 (file)
@@ -1344,8 +1344,11 @@ public abstract class AbstractField<T> extends AbstractComponent implements
     }
 
     private void localeMightHaveChanged() {
-        if (!equals(valueLocale, getLocale())) {
-            Object modelValue = convertToModel(getValue(), valueLocale);
+        if (!equals(valueLocale, getLocale()) && dataSource != null
+                && !isBuffered() && !isModified()) {
+            // When we have a data source and the internal value is directly
+            // read from that we want to update the value
+            Object modelValue = convertToModel(getInternalValue(), valueLocale);
             setValue(convertFromModel(modelValue));
         }
     }