I wrote this simple app, where the RootPage has only a single child, named \'form\'. This child \'FormBuilder\' is directly taken from formbuilder.py in the example directory of last svn Nevow. The child is correctly rendered but when I try to add an element to the form, it doesn\'t appear (the formbuilder example work well if a try the Nevow example). Any help? ############################ ### Root Page ############################ from nevow import loaders from nevow import rend from nevow import tags as T from nevow.stan import directive from formbuilder import FormBuilder class RootPage(rend.Page): addSlash = True docFactory = loaders.stan( T.html [ T.body [ T.a ( href=\'form\' ) [ \'form page\' ] ] ] ) def child_form(self, ctx): return FormBuilder() ############################ -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Con la Pietra Naturale puoi grigliare carne, pesce e verdura direttamente in tavola! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2743&d=20050107
I wrote this simple app, where the RootPage has only a single child, named 'form'. This child 'FormBuilder' is directly taken from formbuilder.py in the example directory of last svn Nevow. The child is correctly rendered but when I try to add an element to the form, it doesn't appear (the formbuilder example work well if a try the Nevow example).
Any help?
Because you always return a new formbuilder when accessing child_form. So modifications are lost after the request is processed. You must keep it in the user session somehow. Eric.
On Jan 7, 2005, at 8:50 AM, Eric Faurot wrote:
I wrote this simple app, where the RootPage has only a single child, named 'form'. This child 'FormBuilder' is directly taken from formbuilder.py in the example directory of last svn Nevow. The child is correctly rendered but when I try to add an element to the form, it doesn't appear (the formbuilder example work well if a try the Nevow example).
Any help?
Because you always return a new formbuilder when accessing child_form. So modifications are lost after the request is processed. You must keep it in the user session somehow.
Or if you want to be like the original example, where the form is global for all users, make the FormBuilder instance once, and always return the same thing. There's lots of ways you could do that, but the easiest way is: - def child_form(self, ctx): - return FormBuilder() + child_form = FormBuilder() James
participants (3)
-
Eric Faurot
-
James Y Knight
-
Tazzo