]> source.dussan.org Git - gwtquery.git/commitdiff
Fix default negative maxlengh in textbox
authorManolo Carrasco <manolo@apache.org>
Wed, 14 Sep 2011 10:33:38 +0000 (10:33 +0000)
committerManolo Carrasco <manolo@apache.org>
Wed, 14 Sep 2011 10:33:38 +0000 (10:33 +0000)
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/TextBoxBaseWidgetFactory.java

index 50ffb209b6659cb70e1cb8bcd6972167f7f04137..af82d24120ae693880f74f739e6f3ace223f73fb 100644 (file)
@@ -17,8 +17,7 @@ package com.google.gwt.query.client.plugins.widgets;
 
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.dom.client.InputElement;
-import com.google.gwt.query.client.plugins.widgets.WidgetFactory;
-import com.google.gwt.query.client.plugins.widgets.WidgetsUtils;
+import com.google.gwt.query.client.GQuery;
 import com.google.gwt.user.client.ui.TextBoxBase;
 
 /**
@@ -49,16 +48,15 @@ public abstract class TextBoxBaseWidgetFactory<T extends TextBoxBase>
   protected void copyAttributes(Element src, Element dest) {
     InputElement source = src.cast();
     InputElement destination = dest.cast();
-    
+
     destination.setAccessKey(source.getAccessKey());
     destination.setDefaultValue(source.getDefaultValue());
     destination.setDisabled(source.isDisabled());
-    destination.setMaxLength(source.getMaxLength());
+    if (source.getMaxLength() > 0) destination.setMaxLength(source.getMaxLength());
     destination.setReadOnly(source.isReadOnly());
     destination.setSize(source.getSize());
     destination.setName(source.getName());
     destination.setValue(source.getValue());
-    
   }
 
   protected abstract T createWidget();