From: Manolo Carrasco Date: Wed, 14 Sep 2011 10:33:38 +0000 (+0000) Subject: Fix default negative maxlengh in textbox X-Git-Tag: release-1.3.2~206 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c5f692eb8fe1fa2a785468bc7fd999d70ecb716d;p=gwtquery.git Fix default negative maxlengh in textbox --- diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/TextBoxBaseWidgetFactory.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/TextBoxBaseWidgetFactory.java index 50ffb209..af82d241 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/TextBoxBaseWidgetFactory.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/TextBoxBaseWidgetFactory.java @@ -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 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();