diff options
author | Henri Sara <henri.sara@gmail.com> | 2017-01-05 17:38:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-05 17:38:33 +0200 |
commit | 11f10b827e92ed7c07d6584a181f7f1374e8109b (patch) | |
tree | 7df28388d5170b733150cea9b4731b32cb094d02 /documentation/layout/layout-formlayout.asciidoc | |
parent | b74e08cfe8a849a8f74e6f9f0a3d7c0475ce196d (diff) | |
download | vaadin-framework-11f10b827e92ed7c07d6584a181f7f1374e8109b.tar.gz vaadin-framework-11f10b827e92ed7c07d6584a181f7f1374e8109b.zip |
Update layout chapter of the documentation for version 8 (#8154)
The SplitPanel chapter still uses a Tree in its example.
Diffstat (limited to 'documentation/layout/layout-formlayout.asciidoc')
-rw-r--r-- | documentation/layout/layout-formlayout.asciidoc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/documentation/layout/layout-formlayout.asciidoc b/documentation/layout/layout-formlayout.asciidoc index c5e7360224..a74e69e64b 100644 --- a/documentation/layout/layout-formlayout.asciidoc +++ b/documentation/layout/layout-formlayout.asciidoc @@ -28,8 +28,7 @@ The following example shows typical use of [classname]#FormLayout# in a form: FormLayout form = new FormLayout(); TextField tf1 = new TextField("Name"); tf1.setIcon(FontAwesome.USER); -tf1.setRequired(true); -tf1.addValidator(new NullValidator("Must be given", false)); +tf1.setRequiredIndicatorVisible(true); form.addComponent(tf1); TextField tf2 = new TextField("Street address"); @@ -38,11 +37,12 @@ form.addComponent(tf2); TextField tf3 = new TextField("Postal code"); tf3.setIcon(FontAwesome.ENVELOPE); -tf3.addValidator(new IntegerRangeValidator("Doh!", 1, 99999)); form.addComponent(tf3); +// normally comes from validation by Binder +tf3.setComponentError(new UserError("Doh!")); ---- -The resulting layout will look as follows. The error message shows in a tooptip +The resulting layout will look as follows. The error message shows in a tooltip when you hover the mouse pointer over the error indicator. [[figure.layout.formlayout]] |