web/formwidgets.py
changeset 10522 1660a0fa4f43
parent 10411 4ee15441f2eb
parent 10479 b0417cacecd9
child 10612 84468b90e9c1
equal deleted inserted replaced
10518:d276e4b332ba 10522:1660a0fa4f43
  1038             self.icon = None
  1038             self.icon = None
  1039         self.name = name
  1039         self.name = name
  1040         self.value = ''
  1040         self.value = ''
  1041         self.onclick = onclick
  1041         self.onclick = onclick
  1042         self.cwaction = cwaction
  1042         self.cwaction = cwaction
  1043         self.attrs.setdefault('class', self.css_class)
       
  1044 
  1043 
  1045     def render(self, form, field=None, renderer=None):
  1044     def render(self, form, field=None, renderer=None):
  1046         label = form._cw._(self.label)
  1045         label = form._cw._(self.label)
  1047         attrs = self.attrs.copy()
  1046         attrs = self.attrs.copy()
       
  1047         attrs.setdefault('class', self.css_class)
  1048         if self.cwaction:
  1048         if self.cwaction:
  1049             assert self.onclick is None
  1049             assert self.onclick is None
  1050             attrs['onclick'] = "postForm('__action_%s', \'%s\', \'%s\')" % (
  1050             attrs['onclick'] = "postForm('__action_%s', \'%s\', \'%s\')" % (
  1051                 self.cwaction, self.label, form.domid)
  1051                 self.cwaction, self.label, form.domid)
  1052         elif self.onclick:
  1052         elif self.onclick: