Class WFSelectionCheckbox

Description

WFSelectionCheckbox is used to create numerous checkboxes representing a selection of items in an array.

A WFDynamic subclass that has specialized behavior for creating a bunch of checkboxes that represent the selected items managed by a WFArrayController.

WFSelectionCheckbox is great for adding a column of checkboxes representing a "selection" of objects to perform an action on, for instance multiple deletes or bulk updates. Another common use is for creating a list of checkboxes in a "search" situation where the checked items represent items whose condition you want to match (maybe generating an IN clause).

PHOCOA Builder Setup:

Required:

Optional:

  • todo: Refactor to coalesce createWidgets and createSelectionWidgets
  • todo: Should WFSelectionCheckbox use WFCheckboxGroup internally for consistency?

Located in /framework/widgets/WFSelectionCheckbox.php (line 30)

WFObject
   |
   --WFView
      |
      --WFWidget
         |
         --WFDynamic
            |
            --WFSelectionCheckbox
Variable Summary
string $label
string $labelKeyPath
Method Summary
static void exposedProperties ()
WFSelectionCheckbox __construct ( $id,  $page)
void createWidgets ()
string render ([string $blockContent = NULL])
void restoreState ()
Variables
string $label (line 47)
  • var: The label to use, if you want to use a static string for the label. If there is a label, labelKeyPath will be ignored.
  • access: protected
string $labelKeyPath (line 43)
  • var: The keyPath to use as the label for each checkbox. By default, this is NULL, and no labels will be output. Supply a valid keyPath for the class managed by your arrayController and the labels will be dynamically generated. If there is a label, labelKeyPath will be ignored. This option is often used in conjunction with oneShotMode.
  • access: protected

Inherited Variables

Inherited from WFDynamic

WFDynamic::$arrayController
WFDynamic::$createdWidgets
WFDynamic::$createdWidgetsChangeCount
WFDynamic::$oneShotMode
WFDynamic::$oneShotSeparatorHTML
WFDynamic::$processedWidgetConfig
WFDynamic::$prototype
WFDynamic::$renderIteration
WFDynamic::$simpleBindKeyPath
WFDynamic::$useUniqueNames
WFDynamic::$widgetClass
WFDynamic::$widgetConfig

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::$originalOnEvent
WFView::$page
WFView::$parent
Methods
static method exposedProperties (line 58)
  • access: public
static void exposedProperties ()

Redefinition of:
WFDynamic::exposedProperties()
Constructor __construct (line 49)
WFSelectionCheckbox __construct ( $id,  $page)
  • $id
  • $page

Redefinition of:
WFDynamic::__construct()
Constructor.
createWidgets (line 76)

Create the dynamic widgets.

This will be called AFTER the _PageDidLoad method... which is what we need to wait for before creating our widgets. WFPage makes this call.

Module code may need to call this function again, particularly if the content of they arrayController is changed by the current action.

  • throws: A variety of exceptions that can occur from createWidgets or createSelectionWidgets.
void createWidgets ()

Redefinition of:
WFDynamic::createWidgets()
Create the dynamic widgets.
render (line 130)

Just before rendering, we want to update the checked status of all managed checkboxes to reflect the selection status of the arrayController.

  • return: Rendered HTML.
string render ([string $blockContent = NULL])
  • string $blockContent: Blockcontent.

Redefinition of:
WFDynamic::render()
restoreState (line 111)

Restore the state of all managed checkboxes.

For WFSelectionCheckbox, that means updating the selection status of the managed arrayController to reflect the checked status of the managed checkboxes.

void restoreState ()

Redefinition of:
WFDynamic::restoreState()
updateSelectionCheckboxes (line 143)

Update the selected status of all checkboxes managed by this instance to reflect the current selection of the managed arrayController.

void updateSelectionCheckboxes ()

Inherited Methods

Inherited From WFDynamic

WFDynamic::__construct()
WFDynamic::addChild()
WFDynamic::calculateParent()
WFDynamic::canPushValueBinding()
WFDynamic::createWidgets()
WFDynamic::exposedProperties()
WFDynamic::getLastRenderedWidget()
WFDynamic::managedWidgets()
WFDynamic::processWidgetConfig()
WFDynamic::render()
WFDynamic::restoreState()
WFDynamic::setArrayController()
WFDynamic::setParentFormID()
WFDynamic::setPrototype()
WFDynamic::setSimpleBindKeyPath()
WFDynamic::setUseUniqueNames()
WFDynamic::setWidgetClass()
WFDynamic::setWidgetConfig()

Inherited From WFWidget

WFWidget::__construct()
WFWidget::addError()
WFWidget::addErrors()
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::getOnEvent()
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::setValuesForKeys()
WFObject::validatedSetValueForKey()
WFObject::validatedSetValueForKeyPath()
WFObject::validateObject()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForStaticKey()
WFObject::valueForStaticKeyPath()
WFObject::valueForTargetAndKeyPath()
WFObject::valueForUndefinedKey()
WFObject::valueForUndefinedStaticKey()
WFObject::valuesForKeyPaths()
WFObject::valuesForKeys()
WFObject::_valueForStaticKey()
WFObject::__toString()

Documentation generated on Thu, 14 May 2009 16:20:29 -0400 by phpDocumentor 1.4.2