]> source.dussan.org Git - vaadin-framework.git/commitdiff
Manual. Updated Form example.
authorMarko Grönroos <magi@iki.fi>
Wed, 4 Jun 2008 09:56:29 +0000 (09:56 +0000)
committerMarko Grönroos <magi@iki.fi>
Wed, 4 Jun 2008 09:56:29 +0000 (09:56 +0000)
svn changeset:4738/svn branch:trunk

src/com/itmill/toolkit/tests/book/FormExample.java

index 5be974a0fcd3494704179e47608b5c109161f07c..22a64af9dca6b719ea657d01b19c3008e73ddb8f 100644 (file)
@@ -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);
     }
 }