[Zope3-Users] Arranging widgets in a form / Limit size of input fields

Maciej Wisniowski maciej.wisniowski at coig.katowice.pl
Thu May 3 03:29:51 EDT 2007

>> One way would be to create a custom template file, where each widget is placed 
>> via HTML. However, this is quite some work. 
> I've often done this and it doesn't seem like too much work. But I don't
> dispute your evaluation.
I've used my own templates as well. It is more work than having
autogenerated form but it is not so hard. In fact you may change
template to use divs instead of tables and then play with css
only to arrange your forms.
> My approach is different to Fred's because I rarely call setUpWidgets in
> my form code. I have a bunch of custom widgets in a known place and use
> custom_widget. Some widgets are for special fields or needs and some are
> as simple as this one. I reuse it very often.:
> class DescriptionWidget(TextAreaWidget):
>     def __init__(self, context, request):
>         super(TextAreaWidget, self).__init__(context, request)
>         self.height = 3
>         self.width = 85
I've used this kind of solution as well.
AFAIK for textarea html fields you can't set something like
maxlength. You have to use javascript for that.

Maciej Wisniowski

More information about the Zope3-users mailing list