diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2008-03-13 14:39:24 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2008-03-13 14:39:24 +0000 |
commit | 972081f7833062edb3f07453cbd4b5c19bfeced6 (patch) | |
tree | 9463520f93d2ec7a54e94acf7c6aabbb55ea9ca9 /src | |
parent | bd4ff3bb1e6c385b0631469b75edc9d4f20d2d04 (diff) | |
download | vaadin-framework-972081f7833062edb3f07453cbd4b5c19bfeced6.tar.gz vaadin-framework-972081f7833062edb3f07453cbd4b5c19bfeced6.zip |
Fixed calendar popup inside modal panel. CalendarPopup now closes on on date select.
svn changeset:4038/svn branch:trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/CalendarPanel.java | 16 | ||||
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/IPopupCalendar.java | 12 |
2 files changed, 26 insertions, 2 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/CalendarPanel.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/CalendarPanel.java index 482c9c6b22..205f4c1822 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/CalendarPanel.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/CalendarPanel.java @@ -420,7 +420,12 @@ public class CalendarPanel extends FlexTable implements MouseListener, cal.datefield.getCurrentDate().getYear() + 1900,
cal.datefield.isImmediate());
- updateCalendar();
+ if (datefield instanceof ITextualDate) {
+ ((ToolkitOverlay) getParent()).hide();
+ } else {
+ updateCalendar();
+ }
+
} catch (final NumberFormatException e) {
// Not a number, ignore and stop here
return;
@@ -462,4 +467,13 @@ public class CalendarPanel extends FlexTable implements MouseListener, public List getEntries(Date date, int resolution);
}
+ /**
+ * Sets focus to Calendar panel.
+ *
+ * @param focus
+ */
+ public void setFocus(boolean focus) {
+ nextYear.setFocus(focus);
+ }
+
}
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IPopupCalendar.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IPopupCalendar.java index 30d9595edf..098967b8d9 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IPopupCalendar.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IPopupCalendar.java @@ -35,7 +35,7 @@ public class IPopupCalendar extends ITextualDate implements Paintable, add(calendarToggle);
calendar = new CalendarPanel(this);
- popup = new ToolkitOverlay(true);
+ popup = new ToolkitOverlay(true, true);
popup.setStyleName(IDateField.CLASSNAME + "-popup");
popup.setWidget(calendar);
popup.addPopupListener(this);
@@ -83,6 +83,7 @@ public class IPopupCalendar extends ITextualDate implements Paintable, // fix size
popup.setWidth(w + "px");
popup.setHeight(h + "px");
+ setFocus(true);
}
});
}
@@ -101,4 +102,13 @@ public class IPopupCalendar extends ITextualDate implements Paintable, }
}
+ /**
+ * Sets focus to Calendar panel.
+ *
+ * @param focus
+ */
+ public void setFocus(boolean focus) {
+ calendar.setFocus(focus);
+ }
+
}
|