From 518e05b52940b34063c434b055a52f248d4e680c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 26 Sep 2011 14:50:47 +0200 Subject: vaadin-app: use setErrorHandler --- vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java b/vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java index bf48c5b..badf223 100644 --- a/vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java +++ b/vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java @@ -107,6 +107,13 @@ class DataMappingLayout extends FormLayout { intProperty.setValue(666); final TextField tf4 = new TextField("MyObjectProperty",intProperty); tf4.setImmediate(true); + tf4.setErrorHandler(new ComponentErrorHandler() { + @Override + public boolean handleComponentError(ComponentErrorEvent event) { + tf4.setComponentError(new UserError("Must be an integer (from handler)")); + return true; + } + }); addComponent(tf4); // Button closeButton = new Button("close the application"); -- cgit v1.1-2-g2b99