summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java b/vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java
index cb9a029..c516e55 100644
--- a/vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java
+++ b/vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java
@@ -7,6 +7,7 @@ import com.vaadin.terminal.UserError;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.data.validator.DoubleValidator;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
@@ -37,6 +38,8 @@ class DataMappingLayout extends FormLayout {
final ObjectProperty<Double> property = new ObjectProperty<Double>(trouble);
final TextField tf2 = new TextField("ObjectProperty", property);
tf2.setImmediate(true);
+ tf2.addValidator( new DoubleValidator("It should be a double") );
+ //tf2.setValidationVisible(false); // nothing will happen
addComponent(tf2);
final Label lb2 = new Label(property);
lb2.setCaption("The Value");