diff options
Diffstat (limited to 'documentation/datamodel')
-rw-r--r-- | documentation/datamodel/datamodel-fields.asciidoc | 2 | ||||
-rw-r--r-- | documentation/datamodel/datamodel-forms.asciidoc | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/documentation/datamodel/datamodel-fields.asciidoc b/documentation/datamodel/datamodel-fields.asciidoc index 651def13a6..ac39c7fda0 100644 --- a/documentation/datamodel/datamodel-fields.asciidoc +++ b/documentation/datamodel/datamodel-fields.asciidoc @@ -25,7 +25,7 @@ Button sayHelloButton = new Button("Say hello", clickEvent -> { }); ---- -Each field implementation has its own specific value type – the type of a [classname]#TextField# is [classname]#String#, the type of a [classname]#Slider# is [classname]#Double#, the type of a [classname]#PopupDateField# is [classname]#LocalDate#, and so on. +Each field implementation has its own specific value type – the type of a [classname]#TextField# is [classname]#String#, the type of a [classname]#Slider# is [classname]#Double#, the type of a [classname]#DateField# is [classname]#LocalDate#, and so on. == Reacting to Value Changes 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); |