diff options
author | Jouni Koivuviita <jouni.koivuviita@itmill.com> | 2009-10-07 06:46:26 +0000 |
---|---|---|
committer | Jouni Koivuviita <jouni.koivuviita@itmill.com> | 2009-10-07 06:46:26 +0000 |
commit | 3c00196a5eb3d0782dbd5f8b58df1f3f98c2d0e1 (patch) | |
tree | 25c803837580f39fa657a037b2910cd10167dc31 /src/com | |
parent | b85b2c8a49a207df8bb7eb5d9b500334286fc339 (diff) | |
download | vaadin-framework-3c00196a5eb3d0782dbd5f8b58df1f3f98c2d0e1.tar.gz vaadin-framework-3c00196a5eb3d0782dbd5f8b58df1f3f98c2d0e1.zip |
Fixes #3456: DateField rendered wrong in readonly mode
svn changeset:9121/svn branch:6.2
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java | 23 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java | 9 |
2 files changed, 9 insertions, 23 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java index 8143eb0ea9..413666b644 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java @@ -60,28 +60,7 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field, }
calendarToggle.setEnabled(enabled);
- handleReadonly();
-
- }
-
- private void handleReadonly() {
- String currentDisplay = calendarToggle.getElement().getStyle()
- .getProperty("display");
- boolean currentReadonly = (currentDisplay != null && currentDisplay
- .equals("none"));
- if (currentReadonly != readonly) {
- // We need to react only if the read-only status has changed
- if (readonly) {
- calendarToggle.getElement().getStyle().setProperty("display",
- "none");
- } else {
- calendarToggle.getElement().getStyle().setProperty("display",
- "");
- }
-
- // Force update of textfield size
- updateWidth();
- }
+ updateWidth();
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java index 11f335e152..c1487f742b 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java @@ -82,6 +82,12 @@ public class VTextualDate extends VDateField implements Paintable, Field, if (uidl.hasAttribute("tabindex")) {
text.setTabIndex(uidl.getIntAttribute("tabindex"));
}
+
+ if (readonly) {
+ text.addStyleDependentName("readonly");
+ } else {
+ text.removeStyleDependentName("readonly");
+ }
}
protected String getFormatString() {
@@ -141,7 +147,8 @@ public class VTextualDate extends VDateField implements Paintable, Field, }
text.setText(dateText);
- text.setEnabled(enabled && !readonly);
+ text.setEnabled(enabled);
+ text.setReadOnly(readonly);
if (readonly) {
text.addStyleName("v-readonly");
|