"Michele Cella" <[EMAIL PROTECTED]> writes:
> 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>'
>>>>
Can you give me an example that works with the AutoCompleteField?
I'm not in my view but I'm defining the form in my controller. This is part
of what used to work perfectly:
form = TableForm(fields = [
widgets.TextField(attrs = {'size':31, 'maxlength': 30},
name = 'mnemonico',
label = lazy_gettext(u'Mnemônico'),
css_classes = ['required'],
validator = validators.UnicodeString(not_empty = True),
),
widgets.TextField(attrs = {'size':51},
name = 'nome',
label = lazy_gettext('Nome'),
css_classes = ['required'],
validator = validators.UnicodeString(not_empty = True),
),
widgets.SingleSelectField(name = 'materialColetado',
label = lazy_gettext(u'Material Coletado'),
options = materiais_coleta,
css_classes = ['required'],
validator = validators.Int(not_empty = True),
),
widgets.AutoCompleteField(label = lazy_gettext(u'Metodologia'),
name='metodologia',
search_controller="/analises/search_metodologia",
search_param="metodologia",
result_name="metodologias",
attrs = {'size':51},
css_classes = ['required'],
validator = validators.UnicodeString(not_empty =
True)),
widgets.TextField(attrs = {'size':4, 'maxlength':3},
name = 'dias_urgente',
label = lazy_gettext(u'Dias úteis pra fornecimento de
resultado urgente'),
css_classes = ['required'],
validator = validators.Int(not_empty = True),
)
]
)
--
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
-~----------~----~----~----~------~----~------~--~---