From 32d5e85dbc1830abf751d3a34979eedb688784d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marko=20Gr=C3=B6nroos?= Date: Wed, 4 Jun 2008 09:56:29 +0000 Subject: [PATCH] Manual. Updated Form example. svn changeset:4738/svn branch:trunk --- src/com/itmill/toolkit/tests/book/FormExample.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/com/itmill/toolkit/tests/book/FormExample.java b/src/com/itmill/toolkit/tests/book/FormExample.java index 5be974a0fc..22a64af9dc 100644 --- a/src/com/itmill/toolkit/tests/book/FormExample.java +++ b/src/com/itmill/toolkit/tests/book/FormExample.java @@ -183,7 +183,17 @@ public class FormExample extends CustomComponent { // Set required fields. form.getField("name").setRequired(true); + // Set the form to act immediately on user input. This is + // Necessary for the validation to occur immediately when the + // input focus changes. form.setImmediate(true); + + // Have the validation error indicator area visible. + form.setValidationVisible(true); + + // Set buffering so that commit() must be called for the form + // before input is written to the data. (Input is not written + // immediately through). form.setWriteThrough(false); form.setReadThrough(false); @@ -197,11 +207,11 @@ public class FormExample extends CustomComponent { ExpandLayout.ALIGNMENT_TOP); footer.setHeight("30px"); footer.addComponent(reset); + form.setFooter(footer); OrderedLayout root = new OrderedLayout(); root.setWidth(400, OrderedLayout.UNITS_PIXELS); root.addComponent(form); - root.addComponent(footer); this.setCompositionRoot(root); } } -- 2.39.5