aboutsummaryrefslogtreecommitdiffstats
path: root/documentation/datamodel/datamodel-forms.asciidoc
diff options
context:
space:
mode:
authorPekka Hyvönen <pekka@vaadin.com>2017-01-04 11:48:45 +0200
committerIlia Motornyi <elmot@vaadin.com>2017-01-04 11:48:45 +0200
commit6ef75bda79099953f85e1c48a0e833a6ed258acf (patch)
tree9098676e92e779bcd0a470f2363007efa0b7941c /documentation/datamodel/datamodel-forms.asciidoc
parent7b9c6bd5d13cf9c004d1cb2d544683ed3e7b17e5 (diff)
downloadvaadin-framework-6ef75bda79099953f85e1c48a0e833a6ed258acf.tar.gz
vaadin-framework-6ef75bda79099953f85e1c48a0e833a6ed258acf.zip
Update general Component documentation
Part of vaadin/framework8-issues#538
Diffstat (limited to 'documentation/datamodel/datamodel-forms.asciidoc')
-rw-r--r--documentation/datamodel/datamodel-forms.asciidoc3
1 files changed, 3 insertions, 0 deletions
diff --git a/documentation/datamodel/datamodel-forms.asciidoc b/documentation/datamodel/datamodel-forms.asciidoc
index 47974986d7..7d3301ae4c 100644
--- a/documentation/datamodel/datamodel-forms.asciidoc
+++ b/documentation/datamodel/datamodel-forms.asciidoc
@@ -97,6 +97,7 @@ binder.bind(nameField,
`Binder` supports checking the validity of the user's input and converting the values between the type used in business objects and the bound UI components.
These to concepts go hand in hand since validation can be based on a converted value, and being able to convert a value is a kind of validation.
+[[datamodel.forms.validation]]
=== Validation
An application typically has some restrictions on exactly what kinds of values the user is allowed to enter into different fields.
@@ -198,6 +199,7 @@ returnBinding.bind(Trip::getReturnDate, Trip::setReturnDate);
departing.addValueChangeListener(event -> returnBinding.validate());
----
+[[datamodel.forms.conversion]]
=== Conversion
You can also bind application data to a UI field component even though the types do not match.
@@ -411,6 +413,7 @@ Button saveButton = new Button("Save", event -> {
When using the `setBean` method, the business object instance will be updated whenever the user changes the value in any bound field.
If some other part of the application is also using the same instance, then that part might show changes before the user has clicked the save button.
+[[datamodel.forms.beans]]
== Binding Beans to Forms
The business objects used in an application are in most cases implemented as Java beans or POJOs.