--- a/web/formwidgets.py Fri Apr 17 11:13:44 2009 +0200
+++ b/web/formwidgets.py Fri Apr 17 11:14:19 2009 +0200
@@ -251,19 +251,19 @@
return txtwidget + cal_button
def _render_calendar_popup(self, form, field):
- req = form.req
- value = form.context[field]['rawvalue']
+ value = form.form_field_value(field)
+ if not value:
+ value = date.today()
inputid = form.context[field]['id']
helperid = '%shelper' % inputid
- if not value:
- value = date.today()
year, month = value.year, value.month
return (u"""<a onclick="toggleCalendar('%s', '%s', %s, %s);" class="calhelper">
<img src="%s" title="%s" alt="" /></a><div class="calpopup hidden" id="%s"></div>"""
% (helperid, inputid, year, month,
- req.external_resource('CALENDAR_ICON'),
- req._('calendar'), helperid) )
+ form.req.external_resource('CALENDAR_ICON'),
+ form.req._('calendar'), helperid) )
+
# ajax widgets ################################################################