Commit 014610b6 authored by Nicolas Dumazet's avatar Nicolas Dumazet

fix TestListbox.test_08_ExtraAndCssFieldsInLinesField: when rendering

non-editable LinesField/TextArea, use a <div> instead of the bare value to
be able to include CSS and Extra attributes


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33633 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2ecc033c
......@@ -531,9 +531,10 @@ class TextAreaWidget(Widget):
extra=field.get_value('extra'))
def render_view(self, field, value, REQUEST, render_prefix=None):
if value is None:
return ''
return value
return render_element("div",
css_class=field.get_value('css_class'),
contents=html_quote(value),
extra=field.get_value('extra'))
def render_odt_view(self, field, value, as_string, ooo_builder, REQUEST,
render_prefix, attr_dict, local_name):
......@@ -593,7 +594,12 @@ class LinesTextAreaWidget(TextAreaWidget):
return ''
elif isinstance(value, (str, unicode)):
value = [value]
return string.join(value, field.get_value('view_separator'))
return TextAreaWidget.render_view(
self,
field,
string.join(value, field.get_value('view_separator')),
REQUEST,
)
def render_odt_view(self, field, value, as_string, ooo_builder, REQUEST,
render_prefix, attr_dict, local_name):
......
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