diff options
author | Pekka Hyvönen <pekka@vaadin.com> | 2016-12-19 19:31:36 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2016-12-19 19:31:36 +0200 |
commit | d8e1ca9ad8ce76185837053a730676fa9fa18352 (patch) | |
tree | 40a0e85d909953c68bbe13c4eade04c9a4fd5860 /documentation/components/components-textfield.asciidoc | |
parent | 33624758f960e9d2f0f67dadd307ae81fd427d65 (diff) | |
download | vaadin-framework-d8e1ca9ad8ce76185837053a730676fa9fa18352.tar.gz vaadin-framework-d8e1ca9ad8ce76185837053a730676fa9fa18352.zip |
Fix documentation for /components (#8051)
Added warning where not updated.
Removed outdated documentation.
Tried to fix parts where it was feasible.
Diffstat (limited to 'documentation/components/components-textfield.asciidoc')
-rw-r--r-- | documentation/components/components-textfield.asciidoc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/documentation/components/components-textfield.asciidoc b/documentation/components/components-textfield.asciidoc index 5ecd2dc70d..1b543ed2ff 100644 --- a/documentation/components/components-textfield.asciidoc +++ b/documentation/components/components-textfield.asciidoc @@ -35,9 +35,7 @@ The result is shown in <<figure.components.textfield.basic>>. .[classname]#TextField# Example image::img/textfield-example.png[width=40%, scaledwidth=50%] -Value changes are handled by adding a listener using either the [methodname]#onChange()# -or [methodname]#addValueChangeListener()# method, as in most other fields. The value can be -acquired with [methodname]#getValue()# directly from the text field or from the parameter +Value changes are handled by adding a listener using [methodname]#addValueChangeListener()# method, as in most other fields. The value can be acquired with [methodname]#getValue()# directly from the text field or from the parameter passed to the event listener. [source, java] @@ -136,8 +134,8 @@ counter.setValue(tf.getValue().length() + " of " + tf.getMaxLength()); // Display the current length interactively in the counter -tf.onChange(value -> { - int len = value.length(); +tf.addValueChangeListener(event -> { + int len = event.getValue().length(); counter.setValue(len + " of " + tf.getMaxLength()); }); |