diff options
author | Aleksi Hietanen <aleksi@vaadin.com> | 2017-02-03 13:40:54 +0200 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2017-02-03 13:40:54 +0200 |
commit | 560d1615408b0ff85439f891c0bb32c84807bd3e (patch) | |
tree | e817140ea7bed012b1e773493e10cb76e7472d13 /documentation/datamodel/datamodel-forms.asciidoc | |
parent | 0a325d95a588010a6d5c511afddb8db8048d50ee (diff) | |
download | vaadin-framework-560d1615408b0ff85439f891c0bb32c84807bd3e.tar.gz vaadin-framework-560d1615408b0ff85439f891c0bb32c84807bd3e.zip |
Add isValid to Binder (#8274)
* Add isValid to Binder
isValid enables you to check the current validation
status of a given Binder, without firing events or invoking
handlers.
This patch also clarifies the javadocs of StatusChangeEvents'
hasValidationErrors.
* Throw in Binder.isValid if no bean is set and bean validators exist
* Add test cases to BinderTest
Diffstat (limited to 'documentation/datamodel/datamodel-forms.asciidoc')
-rw-r--r-- | documentation/datamodel/datamodel-forms.asciidoc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/documentation/datamodel/datamodel-forms.asciidoc b/documentation/datamodel/datamodel-forms.asciidoc index 1fd79dd9b9..0218140425 100644 --- a/documentation/datamodel/datamodel-forms.asciidoc +++ b/documentation/datamodel/datamodel-forms.asciidoc @@ -375,8 +375,8 @@ We can use that event to make the save and reset buttons of our forms become ena [source, java] ---- binder.addStatusChangeListener(event -> { - boolean isValid = !event.hasValidationErrors(); - boolean hasChanges = binder.hasChanges(); + boolean isValid = event.getBinder().isValid(); + boolean hasChanges = event.getBinder().hasChanges(); saveButton.setEnabled(hasChanges && isValid); resetButton.setEnabled(hasChanges); |