diff options
author | Pekka Hyvönen <pekka@vaadin.com> | 2016-08-26 00:29:50 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-09-08 12:15:24 +0000 |
commit | 222908a9372885cc05bc3cb04374aea5aba66139 (patch) | |
tree | 7b63189c5256176126947000a221bb5aeccbee42 /documentation/datamodel/datamodel-forms.asciidoc | |
parent | 3017820a537808c3b6baa337a17f2a8f1585d543 (diff) | |
download | vaadin-framework-222908a9372885cc05bc3cb04374aea5aba66139.tar.gz vaadin-framework-222908a9372885cc05bc3cb04374aea5aba66139.zip |
Add Form level status handler and status label
This feature doesn't make a whole lot of sense until
form level status changes are available.
Change-Id: Ie634c4a6b3511b7cbf9e367192034934b0e0d4b0
Diffstat (limited to 'documentation/datamodel/datamodel-forms.asciidoc')
-rw-r--r-- | documentation/datamodel/datamodel-forms.asciidoc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/documentation/datamodel/datamodel-forms.asciidoc b/documentation/datamodel/datamodel-forms.asciidoc index b86cf8f672..62fd9df38c 100644 --- a/documentation/datamodel/datamodel-forms.asciidoc +++ b/documentation/datamodel/datamodel-forms.asciidoc @@ -566,21 +566,21 @@ We can also define our own status handler to provide a custom way of handling st ---- BinderStatusHandler defaultHandler = binder.getStatusHandler(); -binder.setStatusHandler((List<BinderResult> results) -> { +binder.setStatusHandler(results -> { String errorMessage = results.stream() // Ignore helper and confirmation messages .filter(BinderResult::isError) // Ignore messages that belong to a specific field .filter(error -> !error.getField().isPresent()) // Create a string out of the remaining messages - .map(BinderResult::getMessage) + .map(Result::getMessage).map(o -> o.get()) .collect(Collectors.joining("\n")); formStatusLabel.setValue(errorMessage); formStatusLabel.setVisible(!errorMessage.isEmpty()); // Let the default handler show messages for each field - defaultHandler.handleStatus(results); + defaultHandler.accept(event); }); ---- |