diff options
author | Artur Signell <artur@vaadin.com> | 2012-09-18 16:14:21 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-09-18 16:14:43 +0300 |
commit | 84449d07b0e637ce16cc3d6cde2ec7113130f281 (patch) | |
tree | de5b04b5bbe0d274e84f7096b50512879148530d /server/src/com/vaadin/ui | |
parent | c93035c9812b33718195c829a7231347e095b549 (diff) | |
download | vaadin-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.java | 11 |
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 |