summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-12-18 07:52:41 +0000
committerVaadin Code Review <review@vaadin.com>2012-12-18 07:52:41 +0000
commit9e970eeb721307cd27f923bb8950a4835ca46857 (patch)
tree01b0b5f0e363af1d259749e6468fc0d5666c5d5f
parent1617dbc9298826d112309aa6accc29bdcf64423b (diff)
parent54c6ce1d5247b9399367d6fe814ca3266182a47e (diff)
downloadvaadin-framework-9e970eeb721307cd27f923bb8950a4835ca46857.tar.gz
vaadin-framework-9e970eeb721307cd27f923bb8950a4835ca46857.zip
Merge changes Icf4a4410,I8bbf8f69
* changes: Register connector to avoid test failures Only update value on locale change if using the data source directly (#8192)
-rw-r--r--server/src/com/vaadin/ui/AbstractField.java7
-rw-r--r--server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java2
2 files changed, 7 insertions, 2 deletions
diff --git a/server/src/com/vaadin/ui/AbstractField.java b/server/src/com/vaadin/ui/AbstractField.java
index 59e986cd23..9cf72a36b3 100644
--- a/server/src/com/vaadin/ui/AbstractField.java
+++ b/server/src/com/vaadin/ui/AbstractField.java
@@ -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));
}
}
diff --git a/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java b/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java
index 250fa3f771..467a76dfa6 100644
--- a/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java
+++ b/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java
@@ -48,6 +48,7 @@ public class TestStreamVariableMapping extends TestCase {
}
public void testAddStreamVariable() {
+ owner.getUI().getConnectorTracker().registerConnector(owner);
String targetUrl = cm.getStreamVariableTargetUrl(owner, variableName,
streamVariable);
assertTrue(targetUrl.startsWith("app://APP/UPLOAD/-1/"
@@ -61,6 +62,7 @@ public class TestStreamVariableMapping extends TestCase {
public void testRemoveVariable() {
ConnectorTracker tracker = owner.getUI().getConnectorTracker();
+ tracker.registerConnector(owner);
cm.getStreamVariableTargetUrl(owner, variableName, streamVariable);
assertNotNull(tracker.getStreamVariable(owner.getConnectorId(),
variableName));