Class form_combofield

Description

Combo Field class A field for producing combo boxes (dropdown select menus) or multi-line list-boxes, either of which may be single-select or multiple select.

Located in /form-defs.php (line 1206)

RenderableObject
   |
   --StylableObject
      |
      --HTMLObject
         |
         --form_field
            |
            --form_textfield
               |
               --form_combofield
Direct descendents
Class Description
 class form_jumpmenu Jumpmenu Field class A special case of combofield where we define key/value data made up of display-value and URL pairs.
 class form_radiogroup Radio Group Field class A field which groups a set of radio form elements together.
Variable Summary
 mixed $itemlist
 mixed $multiselect
Method Summary
 form_combofield form_combofield ([string $name = ""], [string $label = ""], [string $value = ""], [boolean $editable = EDITABLE], [string $css = ""], [integer $lines = 1], [boolean $multi = SINGLESELECT])
 void additem (string $key, [string $value = "???"])
 void add_querydata (resource $query, string $keyfield, string $displayfields)
 void clearitems ()
 string html ([mixed $name = ""])
 void ovenready_data (array $data)
 void set_size (integer $lines)
 void set_width (mixed $widthpx, integer $width)
 string wml ([mixed $name = ""])
Variables
Methods
Constructor form_combofield (line 1227)

Constructor Create a field object. Sets basic field attributes.

form_combofield form_combofield ([string $name = ""], [string $label = ""], [string $value = ""], [boolean $editable = EDITABLE], [string $css = ""], [integer $lines = 1], [boolean $multi = SINGLESELECT])
  • string $name: The name of the field
  • string $label: The label which can be displayed alongside the field
  • string $value: The value of the field
  • boolean $editable: Editability: EDITABLE or DISPLAY_ONLY (true or false)
  • string $css: CSS class or style to apply to the button
  • integer $lines: Number of lines to show in the drop-down combo box/listbox
  • boolean $multi: True if the combo is multiple-select, else false
additem (line 1260)

Add a data item Adds a key=>value pair into the combo options collection.

void additem (string $key, [string $value = "???"])
  • string $key: The key to use (the field 'value' or ID)
  • string $value: The value to assign to the key (displayed value)
add_querydata (line 1286)

Add ready-made data. Populates the combo field data from a pre-run query.

void add_querydata (resource $query, string $keyfield, string $displayfields)
  • resource $query: An Axyl query object, pre-executed, with data
  • string $keyfield: The name of the keyfield in the data
  • string $displayfields: The names of displayfields, delimited by "|"
clearitems (line 1266)

Clears any existing items

void clearitems ()
html (line 1322)

This renders the field as HTML.

  • return: The field as HTML.
string html ([mixed $name = ""])

Redefinition of:
form_textfield::html()
This renders the field as HTML.

Redefined in descendants as:
ovenready_data (line 1276)

Add ready-made data Use a ready-made, piping hot source of data. This should be a normal Key/Value pair associative array..

void ovenready_data (array $data)
  • array $data: The array of key=>value pairs to add
set_size (line 1250)

Set select field size in lines.

void set_size (integer $lines)
  • integer $lines: Number of lines to display in the select element.
set_width (line 1241)

Set select field width. Note that selects can only have width set using a style, since they normally auto-set the width to the max length of their options display strings.

void set_width (mixed $widthpx, integer $width)
  • integer $width: Width of select element in pixels

Redefinition of:
form_textfield::set_width()
Set the field width (usually in characters).
wml (line 1294)

This renders the field as WML.

  • return: The field as WML.
string wml ([mixed $name = ""])

Redefinition of:
form_textfield::wml()
This renders the field as WML.

Redefined in descendants as:

Inherited Methods

Inherited From form_textfield

 form_textfield::form_textfield()
 form_textfield::html()
 form_textfield::set_format()
 form_textfield::set_width()
 form_textfield::wml()

Inherited From form_field

 form_field::form_field()
 form_field::as_displayonly()
 form_field::as_hiddenfield()
 form_field::disable_autocomplete()
 form_field::setlabel()
 form_field::setvalue()
 form_field::set_displayonly()

Inherited From HTMLObject

 HTMLObject::HTMLObject()
 HTMLObject::inherit_attributes()
 HTMLObject::setaccesskey()
 HTMLObject::setalign()
 HTMLObject::setalt()
 HTMLObject::setbackground()
 HTMLObject::setbgcolor()
 HTMLObject::setborder()
 HTMLObject::setcolor()
 HTMLObject::setheight()
 HTMLObject::sethspace()
 HTMLObject::setlang()
 HTMLObject::setlangdir()
 HTMLObject::setname()
 HTMLObject::setsize()
 HTMLObject::setsrc()
 HTMLObject::settabindex()
 HTMLObject::settarget()
 HTMLObject::settitle()
 HTMLObject::setvalign()
 HTMLObject::setvspace()
 HTMLObject::setwidth()
 HTMLObject::set_attribute()
 HTMLObject::set_linkover_text()
 HTMLObject::set_onblur()
 HTMLObject::set_onchange()
 HTMLObject::set_onclick()
 HTMLObject::set_ondblclick()
 HTMLObject::set_onfocus()
 HTMLObject::set_onkeydown()
 HTMLObject::set_onkeypress()
 HTMLObject::set_onkeyup()
 HTMLObject::set_onload()
 HTMLObject::set_onmousedown()
 HTMLObject::set_onmousemove()
 HTMLObject::set_onmouseout()
 HTMLObject::set_onmouseover()
 HTMLObject::set_onmouseup()
 HTMLObject::set_onselect()
 HTMLObject::set_tabindex()
 HTMLObject::taghtml()

Inherited From StylableObject

 StylableObject::StylableObject()
 StylableObject::clearstyle()
 StylableObject::setclass()
 StylableObject::setcss()
 StylableObject::setid()
 StylableObject::setstyle()

Inherited From RenderableObject

 RenderableObject::RenderableObject()
 RenderableObject::html()
 RenderableObject::render()
 RenderableObject::wml()
 RenderableObject::wmlup()
 RenderableObject::xml()

Documentation generated by phpDocumentor 1.3.0RC3