Hello list,

I've faced a *very* strange problem when trying to user
CalendarDatePicker.

I've modified controllers.py from FormsTutorial, adding
CalendarDatePicker (the diff to controllers.py from
FormsTutorial/controllers.py is attached).

Now when I'm pressing the 'Choose' button and selecting some date,
nothing happens (e.g., the Calendar form does not dissappear from the
screen and the form field is not updated), and I'm receving

Error: too much recursion
Source File:
http://localhost:8080/tg_widgets/turbogears.widgets/calendar/calendar.js
Line: 14

in my JavaScript console (I'm using Firefox 1.5.0.1 on Windows XP); the
same error occurs with IE 6.0 SP2.

The fun thing is that in Toolbox everything (both CalendarDatePicker
and CalendarDateTimePicker) is working fine.

Anybody has any clue? (Of course, I'm using latest SVN).

Just in case, I've created ticket for it:
http://trac.turbogears.org/turbogears/ticket/597

Regards,
Victor.

Index: /FormsTutorial/formstutorial/controllers.py
===================================================================
--- controllers.py      (revision 12)
+++ controllers.py      (revision 13)
@@ -7,14 +7,17 @@
     name = widgets.TextField(validator=validators.NotEmpty)
     email = widgets.TextField(validator=validators.Email(),
attrs={'size':30})
     comment = widgets.TextArea()
+    date = widgets.CalendarDatePicker(
+            validator=validators.DateConverter(format='%Y/%m/%d'),
+            format='%Y/%m/%d')
     notify = widgets.CheckBox(label="Notify me")

 comment_form = widgets.TableForm(fields=CommentFields(),
                                  submit_text="Post comment")

 class Comments(list):
-    def add(self, name, email, text):
-        self.append((name, email, text, time.ctime()))
+    def add(self, name, email, text, date):
+        self.append((name, email, text, date, time.ctime()))

 comments = Comments()

@@ -36,8 +39,8 @@
     @expose()
     @validate(form=comment_form)
     @error_handler(add)
-    def save(self, name, email, comment, notify=False):
-        comments.add(name, email, comment)
+    def save(self, name, email, comment, date, notify=False):
+        comments.add(name, email, comment, date)
         if notify:
             flash("Comment added! You will be notified.")
         else:


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to