diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2011-04-19 14:10:24 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2011-04-19 14:10:24 +0000 |
commit | 0bec560eff45124c123b912fdac974b619658aaf (patch) | |
tree | 21ca17f9c8a15ba4ecc8c2d5cafae8788ba5be52 /tests | |
parent | 24812fa87ec087b31d7a9d7941eae82540fb9920 (diff) | |
download | vaadin-framework-0bec560eff45124c123b912fdac974b619658aaf.tar.gz vaadin-framework-0bec560eff45124c123b912fdac974b619658aaf.zip |
test case for #6866
svn changeset:18395/svn branch:6.5
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/vaadin/tests/components/textfield/TextChangeEventsWithNonImmediateValueChange.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/textfield/TextChangeEventsWithNonImmediateValueChange.java b/tests/src/com/vaadin/tests/components/textfield/TextChangeEventsWithNonImmediateValueChange.java new file mode 100644 index 0000000000..a893739bff --- /dev/null +++ b/tests/src/com/vaadin/tests/components/textfield/TextChangeEventsWithNonImmediateValueChange.java @@ -0,0 +1,55 @@ +package com.vaadin.tests.components.textfield; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.event.FieldEvents.TextChangeEvent; +import com.vaadin.event.FieldEvents.TextChangeListener; +import com.vaadin.tests.components.TestBase; +import com.vaadin.tests.util.Log; +import com.vaadin.ui.TextField; + +public class TextChangeEventsWithNonImmediateValueChange extends TestBase { + Log l = new Log(5); + + @Override + protected void setup() { + + TextField tf = new TextField("Default"); + + TextChangeListener inputEventListener = new TextChangeListener() { + + public void textChange(TextChangeEvent event) { + l.log("Text change event for " + + event.getComponent().getCaption() + + ", text content currently:'" + event.getText() + + "' Cursor at index:" + event.getCursorPosition()); + } + }; + + tf.addListener(inputEventListener); + + // tf.setImmediate(true); // works when this is set + + tf.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + l.log("Value change:" + event.getProperty().toString()); + } + }); + + getLayout().addComponent(tf); + + getLayout().addComponent(l); + } + + @Override + protected String getDescription() { + return "Type a, pause for a second, type ENTER, type a. Text field should not forget the last textchange event right after valuechange (enter)."; + } + + @Override + protected Integer getTicketNumber() { + return 6866; + } + +}
\ No newline at end of file |