aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/com')
-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