Comments: on this page. Click to read or post your own.

Class DropdownField

Description

Dropdown field, created from a <select> tag.

Located in /sapphire/forms/DropdownField.php (line 7)

Object
   |
   --ViewableData
      |
      --RequestHandlingData
         |
         --FormField
            |
            --DropdownField
Direct descendents
Class Description
PermissionDropdownField Special kind of dropdown field that has all permission codes as its dropdown source.
CountryDropdownField A simple extension to dropdown field, pre-configured to list countries.
LookupField Read-only complement of DropdownField.
DropdownField_WithAdd Dropdown field with an add button to the right.
ListboxField Multi-line listbox field, created from a <select> tag.
GroupedDropdownField Grouped dropdown, using <optgroup> tags.
TypeDropdown Create a dropdown from all instances of a class.
OptionsetField Set of radio buttons designed to emulate a dropdown.
TemplateList This should extend DropdownField
Variable Summary
boolean $disabled
string $emptyString
boolean $isSelected
boolean $source
Method Summary
DropdownField __construct ($name $name, [$title $title = null], [$source $source = array()], [$value $value = ""], [$form $form = null], [$emptyString $emptyString = null])
void extraClass ()
string Field ()
string getEmptyString ()
boolean getHasEmptyDefault ()
array getSource ()
boolean isSelected ()
void setEmptyString (string $str)
void setHasEmptyDefault (boolean $bool)
void setSource (array $source)
Variables
boolean $disabled (line 26)
  • access: protected

Redefinition of:
FormField::$disabled

Redefined in descendants as:
string $emptyString = '' (line 40)
  • var: The title shown for an empty default selection, e.g. "Select...".
  • access: protected
boolean $hasEmptyDefault = false (line 34)
  • var: Show the first <option> element as empty (not having a value), with an optional label defined through $emptyString. By default, the <select> element will be rendered with the first option from $source selected.
  • access: protected
boolean $isSelected (line 21)
  • var: Determines if the field was selected at the time it was rendered, so if $value matches on of the array values specified in $source
  • access: protected
boolean $source (line 14)
  • var: Associative or numeric array of all dropdown items, with array key as the submitted field value, and the array value as a natural language description shown in the interface element.
  • access: protected

Redefined in descendants as:

Inherited Variables

Inherited from FormField

FormField::$containerFieldSet
FormField::$description
FormField::$dontEscape
FormField::$extraClass
FormField::$extraClasses
FormField::$form
FormField::$leftTitle
FormField::$message
FormField::$messageType
FormField::$name
FormField::$readonly
FormField::$rightTitle
FormField::$tabIndex
FormField::$title
FormField::$value

Inherited from RequestHandlingData

RequestHandlingData::$allowed_actions
RequestHandlingData::$request
RequestHandlingData::$url_handlers

Inherited from ViewableData

ViewableData::$casting
ViewableData::$castingHelperPair_cache
ViewableData::$customisedObj
ViewableData::$failover
ViewableData::$iteratorPos
ViewableData::$iteratorTotalItems
ViewableData::$namedAs
ViewableData::$parent
ViewableData::$_natural_cache
ViewableData::$_object_cache
ViewableData::$_xml_cache

Inherited from Object

Object::$builtInMethods
Object::$class
Object::$classConstructed
Object::$extensions
Object::$extension_instances
Object::$extraMethods
Object::$extraStatics
Object::$statics
Object::$static_cached
Methods
Constructor __construct (line 53)

Creates a new dropdown field.

DropdownField __construct ($name $name, [$title $title = null], [$source $source = array()], [$value $value = ""], [$form $form = null], [$emptyString $emptyString = null])
  • $name $name: The field name
  • $title $title: The field title
  • $source $source: An map of the dropdown items
  • $value $value: The current value
  • $form $form: The parent form
  • $emptyString $emptyString: mixed Add an empty selection on to of the $source-Array (can also be boolean, which results in an empty string) Argument is deprecated in 2.3, please use setHasEmptyDefault() and setEmptyString() instead.

Redefinition of:
FormField::__construct()
Create a new field.

Redefined in descendants as:
extraClass (line 170)
void extraClass ()

Redefinition of:
FormField::extraClass()
Compiles all CSS-classes. Optionally includes a "nolabel"-class if no title was set on the formfield.
Field (line 69)

Returns a <select> tag containing all the appropriate <option> tags.

Makes use of FormField->createTag() to generate the <select> tag and option elements inside is as the content of the <select>.

  • return: HTML tag for this dropdown field
string Field ()

Redefinition of:
FormField::Field()
Returns the form field - used by templates.

Redefined in descendants as:
getEmptyString (line 158)
string getEmptyString ()
getHasEmptyDefault (line 139)
boolean getHasEmptyDefault ()
getSource (line 114)

Gets the source array including any empty default values.

array getSource ()

Redefined in descendants as:
isSelected (line 105)
boolean isSelected ()
performReadonlyTransformation (line 162)
void performReadonlyTransformation ()

Redefinition of:
FormField::performReadonlyTransformation()
Returns a readonly version of this field

Redefined in descendants as:
setEmptyString (line 150)

Set the default selection label, e.g. "select...".

Defaults to an empty string. Automatically sets $hasEmptyDefault to true.

void setEmptyString (string $str)
  • string $str
setHasEmptyDefault (line 132)
void setHasEmptyDefault (boolean $bool)
  • boolean $bool
setSource (line 125)
void setSource (array $source)
  • array $source

Inherited Methods

Inherited From FormField

FormField::__construct()
FormField::addExtraClass()
FormField::attrName()
FormField::attrTitle()
FormField::attrValue()
FormField::createTag()
FormField::dataValue()
FormField::debug()
FormField::describe()
FormField::extraClass()
FormField::Field()
FormField::FieldHolder()
FormField::forTemplate()
FormField::getForm()
FormField::getTabIndex()
FormField::getTabIndexHTML()
FormField::hasClass()
FormField::hasData()
FormField::id()
FormField::isComposite()
FormField::isDisabled()
FormField::isReadonly()
FormField::jsValidation()
FormField::LeftTitle()
FormField::Link()
FormField::Message()
FormField::MessageType()
FormField::Name()
FormField::name_to_label()
FormField::performDisabledTransformation()
FormField::performReadonlyTransformation()
FormField::removeExtraClass()
FormField::Required()
FormField::RightTitle()
FormField::rootFieldSet()
FormField::saveInto()
FormField::setContainerFieldSet()
FormField::setDisabled()
FormField::setError()
FormField::setForm()
FormField::setLeftTitle()
FormField::setName()
FormField::setReadonly()
FormField::setRightTitle()
FormField::setTabIndex()
FormField::setTitle()
FormField::setValue()
FormField::SmallFieldHolder()
FormField::Title()
FormField::transform()
FormField::Type()
FormField::validate()
FormField::Value()

Inherited From RequestHandlingData

RequestHandlingData::checkAccessAction()
RequestHandlingData::getRequest()
RequestHandlingData::handleRequest()
RequestHandlingData::httpError()

Inherited From ViewableData

ViewableData::ATT_val()
ViewableData::BaseHref()
ViewableData::buildCastingHelperCache()
ViewableData::cachedCall()
ViewableData::castingHelper()
ViewableData::castingHelperPair()
ViewableData::castingObjectCreator()
ViewableData::castingObjectCreatorPair()
ViewableData::CSSClasses()
ViewableData::CurrentMember()
ViewableData::CurrentPage()
ViewableData::customise()
ViewableData::Debug()
ViewableData::defineMethods()
ViewableData::escapeTypeForField()
ViewableData::Even()
ViewableData::EvenOdd()
ViewableData::First()
ViewableData::FirstLast()
ViewableData::getField()
ViewableData::getIterator()
ViewableData::getXMLValues()
ViewableData::hasField()
ViewableData::HasPerm()
ViewableData::hasValue()
ViewableData::i18nLocale()
ViewableData::IsAjax()
ViewableData::iteratorProperties()
ViewableData::JS_val()
ViewableData::Last()
ViewableData::Me()
ViewableData::Middle()
ViewableData::MiddleString()
ViewableData::obj()
ViewableData::Odd()
ViewableData::Pos()
ViewableData::RAW_val()
ViewableData::renderWith()
ViewableData::SecurityID()
ViewableData::setCustomisedObj()
ViewableData::setField()
ViewableData::SQL_val()
ViewableData::ThemeDir()
ViewableData::Top()
ViewableData::TotalItems()
ViewableData::val()
ViewableData::XML_val()
ViewableData::__get()
ViewableData::__isset()
ViewableData::__set()

Inherited From Object

Object::__construct()
Object::addMethodsFrom()
Object::addStaticVars()
Object::addWrapperMethod()
Object::add_extension()
Object::allMethodNames()
Object::buildMethodList()
Object::cacheToFile()
Object::cacheToFileWithArgs()
Object::create()
Object::createMethod()
Object::defineMethods()
Object::exists()
Object::extend()
Object::extInstance()
Object::getCustomClass()
Object::hasExtension()
Object::hasMethod()
Object::invokeWithExtensions()
Object::is_a()
Object::loadCache()
Object::parentClass()
Object::sanitiseCachename()
Object::saveCache()
Object::set_stat()
Object::set_uninherited()
Object::stat()
Object::strong_create()
Object::uninherited()
Object::useCustomClass()
Object::__call()
Object::__toString()
blog comments powered by Disqus

Documentation generated on Sun, 19 Oct 2008 06:40:29 +1300 by phpDocumentor 1.3.2