durusmail: quixote-users: form2: getting name of currently rendered widget
form2: getting name of currently rendered widget
2004-05-03
form2: getting name of currently rendered widget
Harald Armin Massa
2004-05-03
Hello,

I'm working at a custom rendering of form2 widgets. My objective is to
get forms rendered this way:

 
 
 
that schould give some improvements with accessibility above tables With Quixote 1.0b it's quite comfortable to change the render method: class Form(qxf.Form): def render_field(self, title, contents, hint, error, required=False): title = title or '' if title and required: title = title + htmltext(' *') r = TemplateIO(html=True) r += htmltext('') r += contents r += htmltext('
\n') if error: r += self.render_error(error) if hint: r += self.render_hint(hint) return r.getvalue() but: I cannnot see a equally global way to render the "for"-Parameter of the label tag. ... besides hacking widget.py by: def form_render(self, form): return form.render_field(self.title, self.render(), self.hint, self.error, self.required, self) and adding the self-parameter. Then... why not change the form.render_field api to just pass the widget??? Harald
reply