diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-09-26 14:50:47 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-09-26 14:50:47 +0200 |
commit | 518e05b52940b34063c434b055a52f248d4e680c (patch) | |
tree | 2b4e75a9868d2dfe62788ef77a6ef78780804ad3 /vaadin-app | |
parent | dc0608d8e8c82aeec8261f11dea51e79cf8e38b9 (diff) | |
download | skeletons-518e05b52940b34063c434b055a52f248d4e680c.zip skeletons-518e05b52940b34063c434b055a52f248d4e680c.tar.gz |
vaadin-app: use setErrorHandler
Diffstat (limited to 'vaadin-app')
-rw-r--r-- | vaadin-app/src/ch/asynk/helloworld/HelloWorldApp.java | 7 |
1 files changed, 7 insertions, 0 deletions
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"); |