Class WFCheckbox

Description

A Checkbox widget for our framework.

There are several ways to use checkboxes in your application, depending on the way you want your checkboxes to behave and interact with your data.

  1. A single checkbox representing whether a certain option is "on" or "off". Simply use a WFCheckbox in your application. The value of the WFCheckbox is checkedValue or uncheckedValue, depending on the checkbox's state.
  2. Multiple checkboxes representing multiple "states" that should be enabled for a single property.
    a. If you want to set up the checkboxes statically in .instances/.config, use a WFCheckboxGroup in conjuction with multiple WFCheckbox widgets.
    When using this mode, the values property is an array containing the checkedValue of each selected checkbox. With WFCheckboxGroup, the WFCheckbox uncheckedValue's are not used.

    b. If you want to set up the checkboxes based on the objects in an array, use a WFSelectionCheckbox control and link it to an array of objects.
    When using this mode, which uses WFArrayController, the array controller's selected objects will be updated to reflect the state of the checkboxes.
PHOCOA Builder Setup:

Required:

  • (none)
Optional:

Located in /framework/widgets/WFCheckbox.php (line 37)

WFObject
   |
   --WFView
      |
      --WFWidget
         |
         --WFCheckbox
Variable Summary
boolean $checked
string $checkedValue
boolean $groupMode
string $label
Method Summary
static void exposedProperties ()
WFCheckbox __construct ( $id,  $page)
void checked ()
void checkedValue ()
void groupMode ()
void label ()
void render ([ $blockContent = NULL])
void restoreState ()
void setChecked ( $checked)
void setCheckedValue ( $v)
void setGroupMode ( $enabled)
void setLabel ( $label)
void setUncheckedValue ( $v)
void setValue (mixed $v)
Variables
boolean $checked (line 42)
  • var: Whether or not the checkbox is checked.
  • access: protected
string $checkedValue (line 46)
  • var: The value of the checkbox field when it's checked.
  • access: protected
boolean $groupMode (line 54)
  • var: Whether or not to enable GROUP mode for the checkboxes. GROUP mode checkboxes allow multiple values to be set for the same variable.
  • access: protected
string $label (line 58)
  • var: The label to show next to the checkbox. This will be shown to the RIGHT of the checkbox, and will use the HTML <label> tag to link the checkbox to the label.
  • access: protected
string $uncheckedValue (line 50)
  • var: The value of the checkbox field when it's not checked.
  • access: protected

Inherited Variables

Inherited from WFWidget

WFWidget::$bindings
WFWidget::$class
WFWidget::$errors
WFWidget::$formatter
WFWidget::$hasRestoredState
WFWidget::$hidden
WFWidget::$name
WFWidget::$value
WFWidget::$widgetLabel

Inherited from WFView

WFView::$children
WFView::$cssImports
WFView::$enabled
WFView::$id
WFView::$importInHead
WFView::$jsActions
WFView::$jsEvents
WFView::$jsImports
WFView::$page
WFView::$parent
Methods
static method exposedProperties (line 177)
  • access: public
static void exposedProperties ()

Redefinition of:
WFWidget::exposedProperties()
Constructor __construct (line 63)

Constructor.

WFCheckbox __construct ( $id,  $page)
  • $id
  • $page

Redefinition of:
WFWidget::__construct()
Constructor.
canPushValueBinding (line 223)
void canPushValueBinding ()

Redefinition of:
WFWidget::canPushValueBinding()
Does this widget use the "value" binding to WRITE data back to the bindings?
checked (line 96)
void checked ()
checkedValue (line 86)
void checkedValue ()
groupMode (line 77)
void groupMode ()
label (line 115)
void label ()
render (line 199)
void render ([ $blockContent = NULL])
  • $blockContent

Redefinition of:
WFView::render()
Render the view into HTML.
restoreState (line 146)
void restoreState ()

Redefinition of:
WFWidget::restoreState()
Restore the UI state of this widget from the $_REQUEST data.
setChecked (line 101)
void setChecked ( $checked)
  • $checked
setCheckedValue (line 82)
void setCheckedValue ( $v)
  • $v
setGroupMode (line 73)
void setGroupMode ( $enabled)
  • $enabled
setLabel (line 120)
void setLabel ( $label)
  • $label
setUncheckedValue (line 91)
void setUncheckedValue ( $v)
  • $v
setupExposedBindings (line 189)
void setupExposedBindings ()

Redefinition of:
WFWidget::setupExposedBindings()
Set up all exposed bindings for this widget.
setValue (line 130)

Set the value of the checkbox control. What this does basically, is that if the passed value is the same as the checkedValue, then the checkbox will become checked. Otherwise, it will become unchecked.

void setValue (mixed $v)
  • mixed $v: The value to set for the control.

Redefinition of:
WFWidget::setValue()
Set the value used by the widget.

Inherited Methods

Inherited From WFWidget

WFWidget::__construct()
WFWidget::addError()
WFWidget::bind()
WFWidget::bindingByName()
WFWidget::bindings()
WFWidget::canPushValueBinding()
WFWidget::errors()
WFWidget::exposedBindings()
WFWidget::exposedProperties()
WFWidget::formattedValue()
WFWidget::formatter()
WFWidget::hasRestoredState()
WFWidget::hidden()
WFWidget::name()
WFWidget::processBindingOptions()
WFWidget::propagateValueToBinding()
WFWidget::pullBindings()
WFWidget::pushBindings()
WFWidget::restoreState()
WFWidget::setFormatter()
WFWidget::setHidden()
WFWidget::setName()
WFWidget::setupExposedBindings()
WFWidget::setValue()
WFWidget::setWidgetLabel()
WFWidget::unbind()
WFWidget::value()
WFWidget::valueForBinding()
WFWidget::widgetLabel()

Inherited From WFView

WFView::__construct()
WFView::addChild()
WFView::allConfigFinishedLoading()
WFView::children()
WFView::cloneWithID()
WFView::enabled()
WFView::exposedProperties()
WFView::getForm()
WFView::getJSActions()
WFView::getListenerJS()
WFView::getListenerJSInScriptTag()
WFView::getWidgetDir()
WFView::getWidgetWWWDir()
WFView::id()
WFView::importCSS()
WFView::importJS()
WFView::jsEndHTML()
WFView::jsStartHTML()
WFView::page()
WFView::parent()
WFView::removeChild()
WFView::render()
WFView::setEnabled()
WFView::setId()
WFView::setJSonBlur()
WFView::setJSonClick()
WFView::setListener()
WFView::setOnEvent()
WFView::setParent()
WFView::yuiPath()

Inherited From WFObject

WFObject::__construct()
WFObject::exposedProperties()
WFObject::getClass()
WFObject::keyPathToTargetAndKey()
WFObject::setValueForKey()
WFObject::setValueForKeyPath()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForUndefinedKey()
WFObject::__toString()

Documentation generated on Thu, 17 Apr 2008 13:51:33 -0400 by phpDocumentor 1.4.1