summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Koivuviita <jouni.koivuviita@itmill.com>2009-10-12 10:44:12 +0000
committerJouni Koivuviita <jouni.koivuviita@itmill.com>2009-10-12 10:44:12 +0000
commitad81d40557babcd27aba4074381ee63691750b61 (patch)
treeca9d14a1baf7486b9bc9057e20bc3d72a305d17b
parent193c5b920d92c1c22c3755a54e464fa269cf59b0 (diff)
downloadvaadin-framework-ad81d40557babcd27aba4074381ee63691750b61.tar.gz
vaadin-framework-ad81d40557babcd27aba4074381ee63691750b61.zip
Fixes #3506: Width of DateField is shrinking when value is set programmatically.
svn changeset:9163/svn branch:6.2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java5
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java6
2 files changed, 9 insertions, 2 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java
index 413666b644..9b74167689 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java
@@ -50,6 +50,7 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field,
@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
+ boolean lastReadOnlyState = readonly;
super.updateFromUIDL(uidl, client);
addStyleName(CLASSNAME + "-popupcalendar");
popup.setStyleName(VDateField.CLASSNAME + "-popup "
@@ -60,7 +61,9 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field,
}
calendarToggle.setEnabled(enabled);
- updateWidth();
+ if (lastReadOnlyState != readonly) {
+ updateWidth();
+ }
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java
index c1487f742b..af04890881 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java
@@ -302,8 +302,12 @@ public class VTextualDate extends VDateField implements Paintable, Field,
*/
protected int getFieldExtraWidth() {
if (fieldExtraWidth < 0) {
- text.setWidth("0px");
+ text.setWidth("0");
fieldExtraWidth = text.getOffsetWidth();
+ if (BrowserInfo.get().isFF3()) {
+ // Firefox somehow always leaves the INPUT element 2px wide
+ fieldExtraWidth -= 2;
+ }
}
return fieldExtraWidth;
}