From d8e1ca9ad8ce76185837053a730676fa9fa18352 Mon Sep 17 00:00:00 2001
From: Pekka Hyvönen <pekka@vaadin.com>
Date: Mon, 19 Dec 2016 19:31:36 +0200
Subject: Fix documentation for /components (#8051)

Added warning where not updated.
Removed outdated documentation.
Tried to fix parts where it was feasible.
---
 documentation/components/components-textfield.asciidoc | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

(limited to 'documentation/components/components-textfield.asciidoc')

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());
 });
 
-- 
cgit v1.2.3

