Commit 14900697 authored by Jérome Perrin's avatar Jérome Perrin

initialize _v_relation_field_index in MultiRelationField instead of in Form,...

initialize _v_relation_field_index in MultiRelationField instead of in Form, because other components can use RelationFields (eg. Reports)



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9795 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 54a9e0b1
...@@ -372,8 +372,6 @@ class ERP5Form(ZMIForm, ZopePageTemplate): ...@@ -372,8 +372,6 @@ class ERP5Form(ZMIForm, ZopePageTemplate):
# We initialize here an index which is used to generate # We initialize here an index which is used to generate
# different method ids for every field # different method ids for every field
request = extra_context['request'] request = extra_context['request']
# XXX We must not use a counter, but a ID for each field
request.set('_v_relation_field_index', 0)
return pt.pt_render(extra_context=extra_context) return pt.pt_render(extra_context=extra_context)
def _exec(self, bound_names, args, kw): def _exec(self, bound_names, args, kw):
......
...@@ -248,7 +248,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -248,7 +248,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
Render text input field. Render text input field.
""" """
html_string = '' html_string = ''
relation_field_index = REQUEST.get('_v_relation_field_index') relation_field_index = REQUEST.get('_v_relation_field_index', 0)
render_parameter_list = self._generateRenderValueList( render_parameter_list = self._generateRenderValueList(
field, key, value, field, key, value,
REQUEST) REQUEST)
......
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