diff -r 37154aa90947 -r e033939d5664 web/views/formrenderers.py --- a/web/views/formrenderers.py Thu Jul 30 18:50:41 2009 +0200 +++ b/web/views/formrenderers.py Thu Jul 30 18:51:44 2009 +0200 @@ -306,12 +306,17 @@ """specific renderer for multiple entities edition form (muledit)""" id = 'composite' + _main_display_fields = None + def render_fields(self, w, form, values): if not form.is_subform: w(u'') super(EntityCompositeFormRenderer, self).render_fields(w, form, values) if not form.is_subform: w(u'
') + if self._main_display_fields: + super(EntityCompositeFormRenderer, self)._render_fields( + self._main_display_fields, w, form) def _render_fields(self, fields, w, form): if form.is_subform: @@ -334,17 +339,22 @@ elif isinstance(field.widget, fwdgs.Input): field.widget.attrs['onkeypress'] = cbsetstate w(u'
%s
' % field.render(form, self)) - w(u'') + w(u'') else: - # main form, display table headers - w(u'') - w(u'%s' - % tags.input(type='checkbox', title=self.req._('toggle check boxes'), - onclick="setCheckboxesState('eid', this.checked)")) - for field in self.forms[0].fields: - if self.display_field(form, field) and field.is_visible(): + self._main_display_fields = fields + subfields = [field for field in form.forms[0].fields + if self.display_field(form, field) + and field.is_visible()] + if subfields: + # main form, display table headers + w(u'') + w(u'%s' % + tags.input(type='checkbox', + title=self.req._('toggle check boxes'), + onclick="setCheckboxesState('eid', this.checked)")) + for field in subfields: w(u'%s' % self.req._(field.label)) - w(u'') + w(u'') class EntityFormRenderer(EntityBaseFormRenderer):