From: Marko Grönroos Date: Wed, 4 Jun 2008 09:56:29 +0000 (+0000) Subject: Manual. Updated Form example. X-Git-Tag: 6.7.0.beta1~4670 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=32d5e85dbc1830abf751d3a34979eedb688784d8;p=vaadin-framework.git Manual. Updated Form example. svn changeset:4738/svn branch:trunk --- 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); } }