diff options
author | Ilia Motornyi <elmot@vaadin.com> | 2017-06-29 10:30:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-29 10:30:57 +0300 |
commit | 9c3868e897541c014e19341f3d58066734f8a6c0 (patch) | |
tree | 6e0d00326c37e80d6478895e5a2470b6a203e445 /documentation/components/components-fields.asciidoc | |
parent | b2c0ac2bac558a4bc497fa3a6d29b8f030511e1a (diff) | |
download | vaadin-framework-9c3868e897541c014e19341f3d58066734f8a6c0.tar.gz vaadin-framework-9c3868e897541c014e19341f3d58066734f8a6c0.zip |
Add an optional HasValue to a ValueContext
Diffstat (limited to 'documentation/components/components-fields.asciidoc')
-rw-r--r-- | documentation/components/components-fields.asciidoc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/documentation/components/components-fields.asciidoc b/documentation/components/components-fields.asciidoc index 1415f98e73..77a308a3bb 100644 --- a/documentation/components/components-fields.asciidoc +++ b/documentation/components/components-fields.asciidoc @@ -170,7 +170,11 @@ class MyValidator implements Validator<String> { Since [interfacename]#Validator# is a functional interface, you can often simply write a lambda expression instead of a full class declaration. There is also an [methodname]#withValidator# overload that creates a -validator from a boolean function and an error message. +validator from a boolean function and an error message. If the application requires +more sophisticated validation diagnostics (e.g. locale-specific), there is a +method [methodname]#withValidator#, which uses a boolean function and an [classname]#ErrorMessageProvider#. +The [classname]#ErrorMessageProvider# can compose diagnostic messages based on the locale of the validation +and the source component value, which are provided with the [classname]#ValueContext#. [source, java] ---- |