Hi Jorge,
using a nested dict you can pass along any option, is that what you
need?
>>> from turbogears.widgets import *
>>> form = TableForm(fields=[TextField(name="age")])
>>> form.render(attrs=dict(age={'size':10}))
'<FORM ACTION="" NAME="form" METHOD="post">\n \n <TABLE
BORDER="0">\n <TR>\n <TD>\n
<LABEL CLASS="fieldlabel" FOR="age">Age</LABEL>\n
</TD>\n <TD>\n <INPUT ID="age"
TYPE="text" CLASS="textfield" NAME="age" SIZE="10">\n
\n \n \n </TD>\n
</TR>\n <TR>\n <TD>\xc2\xa0</TD>\n
<TD>\n <INPUT TYPE="submit"
CLASS="submitbutton">\n \n </TD>\n
</TR>\n </TABLE>\n </FORM>'
>>>
Ciao
Michele
Jorge Godoy wrote:
> Jorge Godoy <[EMAIL PROTECTED]> writes:
>
> > The relevant part of the generated HTML is:
> >
> > <INPUT ID="form_metodologia_text" TYPE="text" NAME="metodologia.text"
> > VALUE="Cromatografia gasosa" CLASS="textfield">
> >
> > Since validator act on 'name' and the LHS of a keyword can't be an
> > expression,
> > I believe that this is the problem. But everything that I tried passing
> > either with attrs or options to this widget, trying to modify the text field
> > gets ignored...
>
> From the changeset for r918
> (http://trac.turbogears.org/turbogears/changeset/918) this
>
> <input type="text" name="${name}" id="autoComplete${field_id}"
> value="${value}" class="${field_class}" py:attrs="attrs"/>
>
> was changed into this
>
> ${textfield.display(value_for(textfield), **options_for(textfield))}
>
>
> Where can I find information on how to pass information for a specific
> subwidget outside of its definition? I've tried the following keywords:
>
> - options
> - attrs
> - text
> - textfield
> - options_for
> - metodologia (the name I used for the AutoCompleteField)
>
> And I tried them inside and outside of dictionaries... I'm probably missing
> the key combination to make it work.
>
> Any hints?
>
>
> --
> Jorge Godoy <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---