if (isReadOnly()) {
throw new Property.ReadOnlyException();
}
+ try {
+ T doubleConvertedFieldValue = convertFromDataSource(convertToModel(newFieldValue));
+ if (!equals(newFieldValue, doubleConvertedFieldValue)) {
+ newFieldValue = doubleConvertedFieldValue;
+ repaintIsNotNeeded = false;
+ }
+ } catch (Throwable t) {
+ // Ignore exceptions in the conversion at this stage. Any
+ // conversion error will be handled later by validate().
+ }
// Repaint is needed even when the client thinks that it knows the
// new state if validity of the component may change
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="http://arturwin.office.itmill.com:8888/" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>http://arturwin.office.itmill.com:8888/run/com.vaadin.tests.converter.ConverterThatEnforcesAFormat?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsconverterConverterThatEnforcesAFormat::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VTextField[0]</td>
+ <td>50.000</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>vaadin=runcomvaadintestsconverterConverterThatEnforcesAFormat::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VTextField[0]</td>
+ <td>50.0202</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsconverterConverterThatEnforcesAFormat::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VTextField[0]</td>
+ <td>50.020</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>vaadin=runcomvaadintestsconverterConverterThatEnforcesAFormat::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VTextField[0]</td>
+ <td>12</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsconverterConverterThatEnforcesAFormat::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VTextField[0]</td>
+ <td>12.000</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>vaadin=runcomvaadintestsconverterConverterThatEnforcesAFormat::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VTextField[0]</td>
+ <td>abc</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsconverterConverterThatEnforcesAFormat::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VTextField[0]</td>
+ <td>abc</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsconverterConverterThatEnforcesAFormat::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VTextField[0]</td>
+ <td>v-textfield-error</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>