summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-09-18 16:14:21 +0300
committerArtur Signell <artur@vaadin.com>2012-09-18 16:14:43 +0300
commit84449d07b0e637ce16cc3d6cde2ec7113130f281 (patch)
treede5b04b5bbe0d274e84f7096b50512879148530d /server/src/com/vaadin/ui
parentc93035c9812b33718195c829a7231347e095b549 (diff)
downloadvaadin-framework-84449d07b0e637ce16cc3d6cde2ec7113130f281.tar.gz
vaadin-framework-84449d07b0e637ce16cc3d6cde2ec7113130f281.zip
Label.setPropertyDataSource now updates the state value (#9618)
Diffstat (limited to 'server/src/com/vaadin/ui')
-rw-r--r--server/src/com/vaadin/ui/Label.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/Label.java b/server/src/com/vaadin/ui/Label.java
index 8b5cd87648..bdac278b1f 100644
--- a/server/src/com/vaadin/ui/Label.java
+++ b/server/src/com/vaadin/ui/Label.java
@@ -170,6 +170,16 @@ public class Label extends AbstractComponent implements Property<String>,
// Use internal value if we are running without a data source
return getState().text;
}
+ return getDataSourceValue();
+ }
+
+ /**
+ * Returns the current value of the data source. Assumes there is a data
+ * source.
+ *
+ * @return
+ */
+ private String getDataSourceValue() {
return ConverterUtil.convertFromModel(getPropertyDataSource()
.getValue(), String.class, getConverter(), getLocale());
}
@@ -258,6 +268,7 @@ public class Label extends AbstractComponent implements Property<String>,
setConverter(c);
}
dataSource = newDataSource;
+ getState().text = getDataSourceValue();
// Listens the new data source if possible
if (dataSource != null