aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/Label.java
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/com/vaadin/ui/Label.java')
-rw-r--r--server/src/com/vaadin/ui/Label.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/src/com/vaadin/ui/Label.java b/server/src/com/vaadin/ui/Label.java
index d037652a09..d7cee2a80d 100644
--- a/server/src/com/vaadin/ui/Label.java
+++ b/server/src/com/vaadin/ui/Label.java
@@ -242,14 +242,17 @@ public class Label extends AbstractComponent implements Property<String>,
((Property.ValueChangeNotifier) dataSource).removeListener(this);
}
+ // Check if the current converter is compatible.
if (newDataSource != null
- && !ConverterUtil.canConverterHandle(getConverter(),
- String.class, newDataSource.getType())) {
- // Try to find a converter
+ && !ConverterUtil.canConverterPossiblyHandle(getConverter(),
+ getType(), newDataSource.getType())) {
+ // There is no converter set or there is no way the current
+ // converter can be compatible.
Converter<String, ?> c = ConverterUtil.getConverter(String.class,
newDataSource.getType(), getSession());
setConverter(c);
}
+
dataSource = newDataSource;
if (dataSource != null) {
// Update the value from the data source. If data source was set to