diff --git a/magnolia-ui-vaadin-integration/src/main/java/info/magnolia/ui/vaadin/integration/jcr/JcrPropertyAdapter.java b/magnolia-ui-vaadin-integration/src/main/java/info/magnolia/ui/vaadin/integration/jcr/JcrPropertyAdapter.java index 6cb56e9..68bf143 100644 --- a/magnolia-ui-vaadin-integration/src/main/java/info/magnolia/ui/vaadin/integration/jcr/JcrPropertyAdapter.java +++ b/magnolia-ui-vaadin-integration/src/main/java/info/magnolia/ui/vaadin/integration/jcr/JcrPropertyAdapter.java @@ -176,24 +176,28 @@ } else if (VALUE_PROPERTY.equals(propertyId)) { if (property.getValue() != null) { try { - String valueString = property.getValue().toString(); - int valueType = jcrProperty.getType(); + // String valueString = property.getValue().toString(); + // int valueType = jcrProperty.getType(); ValueFactory valueFactory = jcrProperty.getSession().getValueFactory(); - Value newValue = PropertyUtil.createValue(valueString, valueType, valueFactory); - jcrProperty.setValue(newValue); + // Value newValue = PropertyUtil.createValue(valueString, valueType, valueFactory); + jcrProperty.setValue(PropertyUtil.createValue(property.getValue(), valueFactory)); } catch (RepositoryException e) { log.error("Could not set JCR property", e); } } } else if (TYPE_PROPERTY.equals(propertyId)) { if (property.getValue() != null) { - // get new type from string int newType; + int oldType; try { newType = PropertyType.valueFromName(property.getValue().toString()); - } catch (IllegalArgumentException e) { + oldType = jcrProperty.getType(); + if (oldType == newType) { + return; // same type, no need to convert the value. + } + } catch (Exception e) { log.warn("Could not set new type for JCR property, unknown type string", e); return; }