FormKit.BaseChoiceClasses
index
/usr/local/share/webware/FormKit/BaseChoiceClasses.py

# This file contains the base classes for ChoiceList and Choice

 
Modules
       
string

 
Classes
       
ChoiceList
FormKit.BaseTagClasses.HTMLElement
Choice

 
class Choice(FormKit.BaseTagClasses.HTMLElement)
    Base class for a single choice in a choice list
 
  Methods defined here:
__init__(self, value, label, type='select', languageStandard='XHTML')
tag(self)
Public method to return the HTML tag for the choice

Methods inherited from FormKit.BaseTagClasses.HTMLElement:
addAttributes(self, attributes)
Public method for adding tag attributes; merges in a dictionary of tag attributes
addClass(self, klass)
Public method for appending a CSS class name to this tag; expects a string
addStyle(self, dict)
Public method for adding a style attribute to a tag; takes a dictionary;
the key is the directive, the value is the parameter.
Duplicate key names override their predecessor.
 
Input like this:
{ 'background-color': 'rgb(255,255,255)',
  'font-size: 11px' }
( trailing semicolon can be used, or not )
 
set a key to None or empty string to remove it from the set
attributes(self)
Returns a dictionary of field element attributes
clearClasses(self)
removes all CSS classes from the tag
dump(self)
Quick and dirty method that returns the label and tag in that order
id(self)
returns the dom id attribute of this htmlElement
label(self)
Generic label parameter access method
languageStandard(self)
Generic parameter access method
name(self)
Generic name parameter access method
setAccessKey(self, key)
Public method for setting the tab index of a field... pass a single character string (a letter)
setID(self, string)
Public utility method to surgically override the id tag attribute
setTabIndex(self, num)
Public method for setting the tab index of a field... pass an integer
value(self)
Generic field value access method

 
class ChoiceList
    This is an abstract class for handling finite lists of options for use in SelectField, CheckboxSet, RadioSet
and related FormKit fields
 
  Methods defined here:
__init__(self, type='select', languageStandard='XHTML')
addChoice(self, value, label)
Public method: pass in a value, and text label to add a selection to this ChoiceList
choices(self)
Public method to return list of choice objects
clear(self)
Public method to clear out all the choices
labels(self)
Public convenience method to return a list of possible choice labels
setSelected(self, value)
Public method to attempt to set this choice list to the choice represented by value
setType(self, type)
Public method to set the type of choices you're making: select | radio | checkbox
values(self)
Public convenience method to return a list of possible values

 
Data
        stderr = <__main__.OutputCatcher instance at 0x801031a28>