Esempio n. 1
0
 def _getWidget(self, i):
     if i not in self._widgets:
         if i == 0:
             field = Set(__name__='1').bind(self.context)
             widget = MultiSelectSetWidget(field, self.vocabulary,
                                           self.request)
             widget.setPrefix(self.name)
             widget.empty_marker_name = widget.name + "-empty-marker"
             widget.size = 3
             self._widgets[0] = widget
         elif i == 1:
             field = Tuple(__name__='', required=False).bind(self.context)
             widget = TupleInputWidget(field, self.request)
             widget.name = self.name
             widget.height = self.vocabulary and 2 or 6
             self._widgets[1] = widget
     return self._widgets[i]
Esempio n. 2
0
 def _getWidget(self, i):
     if i not in self._widgets:
         if i == 0:
             field = Set(__name__="1").bind(self.context)
             widget = MultiSelectSetWidget(field, self.vocabulary, self.request)
             widget.setPrefix(self.name)
             widget.empty_marker_name = widget.name + "-empty-marker"
             widget.size = 3
             self._widgets[0] = widget
         elif i == 1:
             field = Tuple(__name__="", required=False).bind(self.context)
             widget = TupleInputWidget(field, self.request)
             widget.name = self.name
             widget.height = self.vocabulary and 2 or 6
             self._widgets[1] = widget
     return self._widgets[i]