Commit da058910 authored by Romain Courteaud's avatar Romain Courteaud

Bug correction for list render format.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2249 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 25693664
...@@ -257,25 +257,35 @@ class MatrixBoxWidget(Widget.Widget): ...@@ -257,25 +257,35 @@ class MatrixBoxWidget(Widget.Widget):
kwd = {} kwd = {}
kwd['base_id'] = cell_base_id kwd['base_id'] = cell_base_id
cell = getter_method(*kw, **kwd) cell = getter_method(*kw, **kwd)
cell_body = '' cell_body = ''
for attribute_id in editable_attribute_ids: for attribute_id in editable_attribute_ids:
my_field_id = '%s_%s' % (field.id, attribute_id) my_field_id = '%s_%s' % (field.id, attribute_id)
if form.has_field(my_field_id): if form.has_field(my_field_id):
my_field = form.get_field(my_field_id) my_field = form.get_field(my_field_id)
key = my_field.id + '_cell_%s_%s_%s' % (i,j, k) key = my_field.id + '_cell_%s_%s_%s' % (i,j, k)
#LOG("Cell",0,str(cell))
#LOG("Cell",0,str(getter_method)) if cell != None:
#LOG("Cell",0,str(kwd)) attribute_value = my_field.get_value('default', cell = cell, cell_index = kw, cell_position = (i,j, k))
#LOG("Cell",0,str(kw))
attribute_value = my_field.get_value('default', cell = cell,
cell_index = kw, cell_position = (i,j, k))
if render_format == 'list': if render_format=='html':
if not my_field.get_value('hidden'): REQUEST['cell'] = cell
list_result_lines.append(attribute_value) cell_body += str(my_field.render(value = attribute_value, REQUEST = REQUEST, key = key))
REQUEST['cell'] = cell elif render_format == 'list':
cell_body += str(my_field.render(value = attribute_value, REQUEST = REQUEST, key = key)) if not my_field.get_value('hidden'):
list_result_lines.append(attribute_value)
else:
if render_format == 'html':
# XXX no cell exists, we need to display a correct field, without generate plenty of errors...
cell_body += str(my_field.render(value = None, REQUEST=REQUEST, key=key))
elif render_format == 'list':
if not my_field.get_value('hidden'):
list_result_lines.append(None)
list_body = list_body + \ list_body = list_body + \
('<td class=\"%s\">%s</td>' % (td_css, cell_body)) ('<td class=\"%s\">%s</td>' % (td_css, cell_body))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment