Class WFSelect

Description

A Select widget for our framework.

Used to select either a single, or multiple, values.

PHOCOA Builder Setup:

Properties:

Bindings: Required:
Optional:
  • contentValues Set the values for each option specified in contentLabels.
    Binding Options:
      InsertsNullPlaceholder - boolean, true to insert an item for "NULL" value at the top of the list.
      NullPlaceholder - string, the value of the "Null" placeholder item.
  • contentLabels Set the labels for each option specified in contentValues.
    Binding Options:
       InsertsNullPlaceholder - boolean, true to insert an item for "NULL" value at the top of the list.
       NullPlaceholder - string, the label of the "Null" placeholder item.
       ValuePattern - supports ValuePattern binding
  • options Set both contentValues and contentLabels at the same time, from an associative array of format 'value' => 'label'.
    Binding Options:
       InsertsNullPlaceholder - boolean, true to insert an item for "NULL" value at the top of the list.
       NullPlaceholder - string, the label of the "Null" placeholder item.

  • todo: Add support for OPTGROUP. I think to do this we'll need a separate way to do values/labels/options for OPTGROUP capable.

Located in /framework/widgets/WFSelect.php (line 51)

WFObject
   |
   --WFView
      |
      --WFWidget
         |
         --WFSelect
Direct descendents
Class Description
WFJumpSelect A Select widget for our framework that will "jump" to a new URL when the user selects an item.
WFTimeSelect A Select widget for our framework.
Variable Summary
Method Summary
static void exposedProperties ()
WFSelect __construct ( $id,  $page)
void addValue ( $val)
void assertMultiple ( $multiple)
void contentLabels ()
void contentValues ()
void labelFormatter ()
void multiple ()
void processBindingOptions ( $boundProperty,  $options,  &$boundValue)
void pushBindings ()
void render ([ $blockContent = NULL])
void restoreState ()
void setContentLabels ( $labels)
void setContentValues ( $values)
void setFormatter ( $f)
void setJSonChange ( $js)
void setLabelFormatter ( $f)
void setMultiple ( $multiple)
void setOptions (assoc_array $opts)
void setValue ( $val)
void setValues ( $valArray)
void setVisibleItems ( $numItems)
void value ()
void valueIsSelected ( $value)
void valueLabel ()
void values ()
void valuesLabels ()
void visibleItems ()
Variables
array $contentLabels (line 68)
  • var: The items to allow user to select. These are the "labels" that are used if the user selects the item. There should be an equal number of contentValues and contentLabels.
  • access: protected
array $contentValues (line 64)
  • var: The items to allow user to select. These are the "values" that are used if the user selects the item. There should be an equal number of contentValues and contentLabels.
  • access: protected
object WFFormatter $labelFormatter (line 84)
  • var: labelFormatter A formatter for the "label" portion of the data.
  • access: protected
boolean $labelFormatterSkipFirst (line 89)
  • var: Should the label formatter be applied to the first choice? Handy option to use in conjunction with InsertsNullPlaceholder (when NullPlaceholder won't format correctly). Default FALSE
  • access: protected
boolean $multiple (line 60)
  • var: Allow multiple selection?
  • access: protected
assoc_array $options (line 72)
  • var: PLACEHOLDER so that we can use bindings for the setOptions function. Never has any real value.
  • access: protected
array $values (line 56)
  • var: The selected values of the select list, IF multiple is enabled.
  • access: protected
integer $visibleItems (line 76)
  • var: The number of items to show, if MULTIPLE is enabled. Default is 5.
  • access: protected
string $width (line 80)
  • var: CSS width data for the popup. Default is EMPTY. Useful to constrain width of the popup menu. Ex: 80px will yield width: 80px;.
  • 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::$originalOnEvent
WFView::$page
WFView::$parent
Methods
static method exposedProperties (line 112)
  • access: public
static void exposedProperties ()

Redefinition of:
WFWidget::exposedProperties()

Redefined in descendants as:
Constructor __construct (line 94)

Constructor.

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

Redefinition of:
WFWidget::__construct()
Constructor.

Redefined in descendants as:
addValue (line 279)
void addValue ( $val)
  • $val
assertMultiple (line 333)
void assertMultiple ( $multiple)
  • $multiple
canPushValueBinding (line 429)
void canPushValueBinding ()

Redefinition of:
WFWidget::canPushValueBinding()
Does this widget use the "value" binding to WRITE data back to the bindings?

Redefined in descendants as:
contentLabels (line 323)
void contentLabels ()
contentValues (line 303)
void contentValues ()
labelFormatter (line 190)
void labelFormatter ()
multiple (line 209)
void multiple ()
processBindingOptions (line 157)
void processBindingOptions ( $boundProperty,  $options,  &$boundValue)
  • $boundProperty
  • $options
  • &$boundValue

Redefinition of:
WFWidget::processBindingOptions()
Pass the list of binding options to the subclass for modification of the value.
pushBindings (line 338)
void pushBindings ()

Redefinition of:
WFWidget::pushBindings()
Each widget should implement this callback if there are any bindable properties whose values are to be propagated back to the bound objects.
render (line 375)
void render ([ $blockContent = NULL])
  • $blockContent

Redefinition of:
WFView::render()
Render the view into HTML.

Redefined in descendants as:
restoreState (line 354)
void restoreState ()

Redefinition of:
WFWidget::restoreState()
Restore the UI state of this widget from the $_REQUEST data.
setContentLabels (line 328)
void setContentLabels ( $labels)
  • $labels
setContentValues (line 318)
void setContentValues ( $values)
  • $values
setFormatter (line 195)
void setFormatter ( $f)
  • $f

Redefinition of:
WFWidget::setFormatter()
Attach a formatter to the widget.
setJSonChange (line 107)
void setJSonChange ( $js)
  • $js
setLabelFormatter (line 185)
void setLabelFormatter ( $f)
  • $f
setMultiple (line 214)
void setMultiple ( $multiple)
  • $multiple
setOptions (line 312)

A convenience function to set both values and labels simultaneously from an associative array.

void setOptions (assoc_array $opts)
  • assoc_array $opts: A list of value => label.
setupExposedBindings (line 124)
void setupExposedBindings ()

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

Redefined in descendants as:
setValue (line 225)
void setValue ( $val)
  • $val

Redefinition of:
WFWidget::setValue()
Set the value used by the widget.
setValues (line 248)
void setValues ( $valArray)
  • $valArray
setVisibleItems (line 200)
void setVisibleItems ( $numItems)
  • $numItems
value (line 230)
void value ()

Redefinition of:
WFWidget::value()
Get the value for the widget.
valueIsSelected (line 258)
void valueIsSelected ( $value)
  • $value
valueLabel (line 235)
void valueLabel ()
values (line 285)
void values ()
valuesLabels (line 290)
void valuesLabels ()
visibleItems (line 204)
void visibleItems ()

Inherited Methods

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:28 -0400 by phpDocumentor 1.4.2