From 6ef75bda79099953f85e1c48a0e833a6ed258acf Mon Sep 17 00:00:00 2001 From: Pekka Hyvönen Date: Wed, 4 Jan 2017 11:48:45 +0200 Subject: Update general Component documentation Part of vaadin/framework8-issues#538 --- documentation/datamodel/datamodel-forms.asciidoc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'documentation/datamodel/datamodel-forms.asciidoc') 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. -- cgit v1.2.3