Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Properties
plone.app.form.widgets.checkboxwidget.DisabledCheckBoxWidget Class Reference
Inheritance diagram for plone.app.form.widgets.checkboxwidget.DisabledCheckBoxWidget:
Inheritance graph
[legend]
Collaboration diagram for plone.app.form.widgets.checkboxwidget.DisabledCheckBoxWidget:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def error
def __call__

Public Attributes

 required
 name

Static Public Attributes

 disabled = True

Properties

 label = property(lambda self: "")
 hint = property(lambda self: "")

Detailed Description

Simple variation of the CheckBoxWidget which renders itself disabled.

Definition at line 64 of file checkboxwidget.py.


Member Function Documentation

Render the widget to HTML.

Definition at line 28 of file checkboxwidget.py.

00028 
00029     def __call__( self ):
00030         """Render the widget to HTML."""
00031         value = self._getFormValue()
00032         html = "<label for='%s'>%s</label>\n" % (self.name , translate(super(BaseWidget,self).label, context=self.request))
00033         if self.__required:
00034             html += "<span class='fieldRequired' title='%s'>%s</span>" % (translate(_(u'title_required'), context=self.request, default='Required'), translate(_(u'label_required'), context=self.request, default='(Required)'))
00035         if super(BaseWidget, self).hint:
00036             html += "<div class='formHelp'>%s</div>" % translate(super(BaseWidget, self).hint, context=self.request)
00037         if super(BaseWidget, self).error() != '':
00038             html += "<div>%s</div>" % translate(super(BaseWidget, self).error(), context=self.request)
00039         
00040         if value == 'on':
00041             kw = {'checked': 'checked'}
00042         else:
00043             kw = {}
00044         if self.disabled:
00045             kw['disabled'] = 'disabled'
00046         return "%s  %s %s" % (
00047             renderElement(self.tag,
00048                           type='hidden',
00049                           name=self.name+".used",
00050                           id=self.name+".used",
00051                           value=""
00052                           ),
00053             renderElement(self.tag,
00054                           type=self.type,
00055                           name=self.name,
00056                           id=self.name,
00057                           cssClass=self.cssClass,
00058                           extra=self.extra,
00059                           value="on",
00060                           **kw),
00061             html
00062             )
00063 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 25 of file checkboxwidget.py.

00025 
00026     def error(self):
00027         return ""

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from plone.app.form.widgets.checkboxwidget.CheckBoxWidget.

Definition at line 68 of file checkboxwidget.py.

Definition at line 17 of file checkboxwidget.py.

Definition at line 15 of file checkboxwidget.py.


Property Documentation

plone.app.form.widgets.checkboxwidget.CheckBoxWidget.hint = property(lambda self: "") [static, inherited]

Definition at line 21 of file checkboxwidget.py.

plone.app.form.widgets.checkboxwidget.CheckBoxWidget.label = property(lambda self: "") [static, inherited]

Definition at line 19 of file checkboxwidget.py.


The documentation for this class was generated from the following file: