]> source.dussan.org Git - vaadin-framework.git/commitdiff
#7092 TextField does not support setting maxLength=0
authorLeif Åstrand <leif@vaadin.com>
Tue, 23 Aug 2011 07:14:26 +0000 (07:14 +0000)
committerLeif Åstrand <leif@vaadin.com>
Tue, 23 Aug 2011 07:14:26 +0000 (07:14 +0000)
svn changeset:20550/svn branch:6.7

src/com/vaadin/terminal/gwt/client/ui/VTextField.java
tests/src/com/vaadin/tests/components/textfield/TextFieldMaxLength.html

index a05cef3984e49be18e576cafc5a37f82d9d24af8..8bc655f39f1467b07a4e1ee170f048001ad178f2 100644 (file)
@@ -351,7 +351,7 @@ public class VTextField extends TextBoxBase implements Paintable, Field,
     }
 
     private void setMaxLength(int newMaxLength) {
-        if (newMaxLength > 0) {
+        if (newMaxLength >= 0) {
             maxLength = newMaxLength;
             if (getElement().getTagName().toLowerCase().equals("textarea")) {
                 // NOP no maxlength property for textarea
index f8c59e0bcf88b64fba131b3b469775424167ae90..01c35aeea0df6072449e4b81c2d06ddd9d5d7784 100644 (file)
@@ -4,12 +4,12 @@
 <head profile="http://selenium-ide.openqa.org/profiles/test-case">\r
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
 <link rel="selenium.base" href="" />\r
-<title>New Test</title>\r
+<title>TextFieldMaxLength</title>\r
 </head>\r
 <body>\r
 <table cellpadding="1" cellspacing="1" border="1">\r
 <thead>\r
-<tr><td rowspan="1" colspan="3">New Test</td></tr>\r
+<tr><td rowspan="1" colspan="3">TextFieldMaxLength</td></tr>\r
 </thead><tbody>\r
 <tr>\r
        <td>open</td>\r
        <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_SLog/ChildComponentContainer[0]/VLabel[0]</td>\r
        <td>6. ValueChangeEvent, new value: '123456789012345'</td>\r
 </tr>\r
+<!--MaxLength 0-->\r
+<tr>\r
+       <td>mouseClick</td>\r
+       <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item0</td>\r
+       <td>20,8</td>\r
+</tr>\r
+<tr>\r
+       <td>mouseClick</td>\r
+       <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item5</td>\r
+       <td>33,5</td>\r
+</tr>\r
+<tr>\r
+       <td>mouseClick</td>\r
+       <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[1]/VMenuBar[0]#item2</td>\r
+       <td>51,3</td>\r
+</tr>\r
+<tr>\r
+       <td>mouseClick</td>\r
+       <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[2]/VMenuBar[0]#item0</td>\r
+       <td>9,9</td>\r
+</tr>\r
+<!--Enter some text-->\r
+<tr>\r
+       <td>enterCharacter</td>\r
+       <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_StestComponent</td>\r
+       <td>123456789012345</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_StestComponent</td>\r
+       <td></td>\r
+</tr>\r
+<tr>\r
+       <td>assertText</td>\r
+       <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_SLog/ChildComponentContainer[0]/VLabel[0]</td>\r
+       <td>8. ValueChangeEvent, new value: ''</td>\r
+</tr>\r
 </tbody></table>\r
 </body>\r
 </html>\r