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

In the case of MultiLinkField, we don't want to add an empty <a> element.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23141 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cc247fbf
...@@ -31,6 +31,7 @@ from Products.Formulator.Widget import ListWidget ...@@ -31,6 +31,7 @@ from Products.Formulator.Widget import ListWidget
from Products.Formulator.Widget import RadioWidget from Products.Formulator.Widget import RadioWidget
from Products.Formulator.Widget import MultiItemsWidget from Products.Formulator.Widget import MultiItemsWidget
from ProxyField import ProxyField from ProxyField import ProxyField
from MultiLinkField import MultiLinkFieldWidget
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from DocumentTemplate.ustr import ustr from DocumentTemplate.ustr import ustr
from cgi import escape from cgi import escape
...@@ -714,8 +715,11 @@ def MultiItemsWidget_render_items(self, field, key, value, REQUEST, render_prefi ...@@ -714,8 +715,11 @@ def MultiItemsWidget_render_items(self, field, key, value, REQUEST, render_prefi
items = field.get_value('items',REQUEST=REQUEST, cell=getattr(REQUEST,'cell',None)) # Added request items = field.get_value('items',REQUEST=REQUEST, cell=getattr(REQUEST,'cell',None)) # Added request
if not items: if not items:
if not isinstance(self, MultiLinkFieldWidget):
# multi items widget should have at least one child in order to produce # multi items widget should have at least one child in order to produce
# valid XHTML; disable it so user can not select it # valid XHTML; disable it so user can not select it.
# This cannot be applied to MultiLinkFields, which are just some <a>
# links
return [self.render_item('', '', '', '', 'disabled="disabled"')] return [self.render_item('', '', '', '', 'disabled="disabled"')]
css_class = field.get_value('css_class') css_class = field.get_value('css_class')
......
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