diff options
author | Denis Anisimov <denis@vaadin.com> | 2016-09-27 10:41:37 +0300 |
---|---|---|
committer | Denis Anisimov <denis@vaadin.com> | 2016-09-30 06:56:18 +0000 |
commit | d36d63fefa3ab9f4908f97772bcc6499e4f52532 (patch) | |
tree | d2189db8f44601925a96435dedec031459eeed57 /documentation/datamodel/datamodel-forms.asciidoc | |
parent | db3a91c9b4d8d0451c8f1c5e875f4c6f6f50324a (diff) | |
download | vaadin-framework-d36d63fefa3ab9f4908f97772bcc6499e4f52532.tar.gz vaadin-framework-d36d63fefa3ab9f4908f97772bcc6499e4f52532.zip |
Make AbstractDateField based on LocalDate (#125).
Change-Id: I33a4a4f0f3437a8d1733031a131afbe844c12afb
Diffstat (limited to 'documentation/datamodel/datamodel-forms.asciidoc')
-rw-r--r-- | documentation/datamodel/datamodel-forms.asciidoc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/documentation/datamodel/datamodel-forms.asciidoc b/documentation/datamodel/datamodel-forms.asciidoc index 3c2dd95bb5..8772f0d770 100644 --- a/documentation/datamodel/datamodel-forms.asciidoc +++ b/documentation/datamodel/datamodel-forms.asciidoc @@ -200,12 +200,12 @@ We can save the binding to a local variable and trigger a revalidation when anot [source, java] ---- -PopupDateField departing = new PopupDateField("Departing"); -PopupDateField returning = new PopupDateField("Returning"); +DateField departing = new DateField("Departing"); +DateField returning = new DateField("Returning"); // Store return date binding so we can revalidate it later -Binding<Trip, Date, Date> returnBinding = binder.forField(returning) - .withValidator(returnDate -> !returnDate.before(departing.getValue()), +Binding<Trip, LocalDate, LocalDate> returnBinding = binder.forField(returning) + .withValidator(returnDate -> !returnDate.isBefore(departing.getValue()), "Cannot return before departing"); returnBinding.bind(Trip::getReturnDate, Trip::setReturnDate); |