formelements
[ class tree: formelements ] [ index: formelements ] [ all elements ]

Class: SelectList

Source Location: /HtmlForm.FormElement.SelectList.class.php

Class Overview

FormElement
   |
   --Select
      |
      --SelectList

Constitutes a Select-replacement made of a list of labeled radiobuttons/checkboxes.


Author(s):

  • Sebastian Schlapkohl

Version:

  • 1.0

Constants

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: Select

Select::__construct()
Hidden constructor.
Select::doRender()
Compiles and returns the html-fragment for the element.
Select::get()
Factory method for Select, returns new instance.
Select::getValue()
Returns the current value of the element.
Select::isDisabledOption()
Select::isSelectedOption()
Select::refill()
Tries to refill the selected options from existing data.
Select::setDisabled()
Set the element disabled, or set single options disabled.
Select::setMultiple()
Set the select to being a multi-select.
Select::setOptionCssClasses()
Sets css-classes to set for the options.
Select::setOptions()
Sets all available options of the select.
Select::setOptionTitles()
Sets html-title to set for the options.
Select::setSelected()
Sets selected single/multiple options by index/value.
Select::setSingle()
Set the select to being a single-select.
Select::setSize()
Sets the amount of rows the select should have, especially needed for multi-selects.
Select::validate()
Starts the validation-process for the element.

Class: FormElement

FormElement::__construct()
General abstract, hidden formelement constructor.
FormElement::addCssClasses()
Adds one or many css-classes to the element's class-attribute.
FormElement::addElement()
Adds a subelement to the element.
FormElement::determineRefiller()
Returns the supposed source of refill values.
FormElement::doRender()
Returns the compiled html-code for the element.
FormElement::getId()
Return the element's html-id.
FormElement::getLabel()
Return the element's label text.
FormElement::getMasterElement()
Return the currently connected owner element for the element.
FormElement::getMasterForm()
Returns the currently connected owner form for the element.
FormElement::getName()
Return the element's html-name.
FormElement::getSubElements()
Return all owned elements of this element.
FormElement::getTitle()
Return the element's html-title.
FormElement::getValidator()
Return the currently connected validator for the element.
FormElement::getValue()
Returns the value of the element if there is any.
FormElement::getValueSet()
Returns the compiled valueset for this element including the elements owned by this one.
FormElement::insertElementAfter()
Searches the subelements of the element if present and inserts a given element after the first found one.
FormElement::isValid()
Answers if the element is in a valid state at the moment.
FormElement::needsUtf8Safety()
Answers if the element needs to be treated with precautions according to possible utf-8 values.
FormElement::printCssClasses()
Compiles the html-class-attribute-string of the element.
FormElement::printDisabled()
Compiles the html-disabled-attribute-string of the element.
FormElement::printId()
Compiles the html-id-attribute-string of the element.
FormElement::printJavascriptEventHandler()
Compiles html-javascript-eventhandler-string of the element.
FormElement::printJavascriptValidationCode()
Grabs the compiled JS-validation-code for the element from its validator, if present and returns the code as a string.
FormElement::printMessages()
Returns a string of all aggregated error messages of the element.
FormElement::printName()
Compiles the html-name-string of the element.
FormElement::printNameArray()
Comiles the html-name-string of the element, if the element is part of a group of values.
FormElement::printTabIndex()
Calculates current ongoing tabindex of the form, refreshes it and returns the proper value for the element.
FormElement::printTitle()
Compiles the html-title-string of the element.
FormElement::printWrapperClasses()
Compiles a string of all classes for the tag-wrapper for the element's html-code.
FormElement::setCssClasses()
Sets the html-class-attribute for the element.
FormElement::setDisabled()
Set the element disabled.
FormElement::setId()
Sets the html-id for this element.
FormElement::setJavascriptEventHandler()
Sets a javascript-handler for the element.
FormElement::setLabel()
Inserts a label for the element.
FormElement::setMasterElement()
Sets the owning element for an element.
FormElement::setMasterForm()
Sets the owning form for an element and by doing so inserts the element into the logical structure of the form.
FormElement::setTitle()
Sets the html-title for this element.
FormElement::setUsable()
Set the element usables or disabled based on an expression.
FormElement::setValidator()
Sets a validator for a value-bearing element.
FormElement::validate()
Starts validation for the element and all subelements according to the rules laid out in the element's validator.

Class Details

[line 26]
Constitutes a Select-replacement made of a list of labeled radiobuttons/checkboxes.

Long Selects, especially multiselects, where you select entries by holding ctrl, can be bothersome to handle. This special, non-canonical class, is a reskin of select functionality using radiobuttons and checkboxes to offer an alternative, with better usability, while offering largely the same functionality as a Select. Single selects are build of radiobuttons, while multiselects are build as a list of checkboxes.




Tags:

author:  Sebastian Schlapkohl
version:  1.0


[ Top ]


Class Methods


static method get [line 43]

static SelectList get( String $name, [String $id = ''])

Factory method for SelectList, returns new instance.

Factories are used to make instant chaining possible.




Tags:

return:  new SelectList-instance
access:  public


Overrides Select::get() (Factory method for Select, returns new instance.)

Parameters:

String   $name   html-name for the element
String   $id   html-id for the element

[ Top ]

method doRender [line 82]

String doRender( )

Compiles and returns the html-fragment for the element.



Tags:

return:  html-fragment for the element
access:  public


Overrides Select::doRender() (Compiles and returns the html-fragment for the element.)

[ Top ]


Class Constants

OPTGROUP_CLASS =  'optgroup'

[line 29]


[ Top ]

OPTION_CLASS =  'option'

[line 30]


[ Top ]

SELECT_CLASS =  'select'

[line 28]


[ Top ]



Documentation generated on Fri, 18 Jul 2014 16:32:00 +0200 by phpDocumentor 1.4.3