340 # main form, display table headers |
340 # main form, display table headers |
341 w(u'<tr class="header">') |
341 w(u'<tr class="header">') |
342 w(u'<th align="left">%s</th>' % |
342 w(u'<th align="left">%s</th>' % |
343 tags.input(type='checkbox', |
343 tags.input(type='checkbox', |
344 title=self._cw._('toggle check boxes'), |
344 title=self._cw._('toggle check boxes'), |
345 onclick="setCheckboxesState('eid', this.checked)")) |
345 onclick="setCheckboxesState('eid', null, this.checked)")) |
346 for field in subfields: |
346 for field in subfields: |
347 w(u'<th>%s</th>' % field_label(form, field)) |
347 w(u'<th>%s</th>' % field_label(form, field)) |
348 w(u'</tr>') |
348 w(u'</tr>') |
349 super(EntityCompositeFormRenderer, self).render_fields(w, form, values) |
349 super(EntityCompositeFormRenderer, self).render_fields(w, form, values) |
350 if form.parent_form is None: |
350 if form.parent_form is None: |
356 def _render_fields(self, fields, w, form): |
356 def _render_fields(self, fields, w, form): |
357 if form.parent_form is not None: |
357 if form.parent_form is not None: |
358 entity = form.edited_entity |
358 entity = form.edited_entity |
359 values = form.form_previous_values |
359 values = form.form_previous_values |
360 qeid = eid_param('eid', entity.eid) |
360 qeid = eid_param('eid', entity.eid) |
361 cbsetstate = "setCheckboxesState2('eid', %s, 'checked')" % \ |
361 cbsetstate = "setCheckboxesState('eid', %s, 'checked')" % \ |
362 xml_escape(dumps(entity.eid)) |
362 xml_escape(dumps(entity.eid)) |
363 w(u'<tr class="%s">' % (entity.cw_row % 2 and u'even' or u'odd')) |
363 w(u'<tr class="%s">' % (entity.cw_row % 2 and u'even' or u'odd')) |
364 # XXX turn this into a widget used on the eid field |
364 # XXX turn this into a widget used on the eid field |
365 w(u'<td>%s</td>' % checkbox('eid', entity.eid, |
365 w(u'<td>%s</td>' % checkbox('eid', entity.eid, |
366 checked=qeid in values)) |
366 checked=qeid in values)) |