[Zope-dev] Re: Setting the size of a zope.formlib's schema html input

Simon Michael simon at joyful.com
Tue Apr 8 11:49:51 EDT 2008


> Could someone show me an example of defining a widget to set the size of 
> the rendered input?

Marcelo, here's what I did:


class PromosEditForm(EditForm):
     """An edit form to modify promo selection fields."""
     form_fields = form.FormFields(IContentPromoFields)

     def setUpWidgets(self, ignore_request=False):
         self.adapters = {
             IContentPromoFields:ContentPromoFieldsAdapter(self.context)
             }
	self.widgets = form.setUpEditWidgets(
             self.form_fields, self.prefix, self.context, self.request,
             adapters=self.adapters, ignore_request=ignore_request
             )
         self.label = "..."
         self.description = """\ 
 

         ...
         """
         self.widgets['global_promos'].size  = 5
         etc...


I too would like to see an example of a full custom widget. For example 
I'd like to use an AT InOut-style dual list widget.



More information about the Zope-Dev mailing list