From 2788b5192330a8ac8169571b592be33972c3b016 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Wed, 20 Feb 2013 09:44:43 +0200 Subject: Merge of (#9940) to Vaadin 7 Change-Id: Ie2e53c8cdba20c8265fa04e35e9469b39b21d43e --- .../TextFieldMaxLengthRemovedFromDOM.html | 51 ++++++++++++++++++++++ .../TextFieldMaxLengthRemovedFromDOM.java | 37 ++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/components/textfield/TextFieldMaxLengthRemovedFromDOM.html create mode 100644 uitest/src/com/vaadin/tests/components/textfield/TextFieldMaxLengthRemovedFromDOM.java (limited to 'uitest/src/com') diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextFieldMaxLengthRemovedFromDOM.html b/uitest/src/com/vaadin/tests/components/textfield/TextFieldMaxLengthRemovedFromDOM.html new file mode 100644 index 0000000000..45c7e0f2c8 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/textfield/TextFieldMaxLengthRemovedFromDOM.html @@ -0,0 +1,51 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.components.textfield.TextFieldMaxLengthRemovedFromDOM?restartApplication
assertAttributevaadin=runcomvaadintestscomponentstextfieldTextFieldMaxLengthRemovedFromDOM::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextField[0]@maxlength11
mouseClickvaadin=runcomvaadintestscomponentstextfieldTextFieldMaxLengthRemovedFromDOM::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextField[0]118,13
assertAttributevaadin=runcomvaadintestscomponentstextfieldTextFieldMaxLengthRemovedFromDOM::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextField[0]@maxlength11
typevaadin=runcomvaadintestscomponentstextfieldTextFieldMaxLengthRemovedFromDOM::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextField[0]hello
mouseClickvaadin=runcomvaadintestscomponentstextfieldTextFieldMaxLengthRemovedFromDOM::/VVerticalLayout[0]/domChild[0]/domChild[1]172,60
assertAttributevaadin=runcomvaadintestscomponentstextfieldTextFieldMaxLengthRemovedFromDOM::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextField[0]@maxlength11
+ + diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextFieldMaxLengthRemovedFromDOM.java b/uitest/src/com/vaadin/tests/components/textfield/TextFieldMaxLengthRemovedFromDOM.java new file mode 100644 index 0000000000..61993de107 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/textfield/TextFieldMaxLengthRemovedFromDOM.java @@ -0,0 +1,37 @@ +package com.vaadin.tests.components.textfield; + +import com.vaadin.event.FieldEvents; +import com.vaadin.event.FieldEvents.FocusEvent; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.TextField; + +public class TextFieldMaxLengthRemovedFromDOM extends TestBase { + + @Override + protected void setup() { + final TextField tf = new TextField(); + tf.setMaxLength(11); + tf.setRequired(true); + tf.setImmediate(true); + addComponent(tf); + + tf.addListener(new FieldEvents.FocusListener() { + + public void focus(FocusEvent event) { + // Resetting Max length should not remove maxlength attribute + tf.setMaxLength(11); + } + }); + } + + @Override + protected String getDescription() { + return "Maxlength attribute should not dissappear from the DOM when I focus the text field."; + } + + @Override + protected Integer getTicketNumber() { + return 9940; + } + +} -- cgit v1.2.3