Class STPHPListbox

STPHPObject
   |
   --STPHPComponent
      |
      --STPHPListbox

Classes extended from STPHPListbox:

Located in File: Program_Root/stphplistbox.php




Class Variable Summary
$elements
The list of elements of the listbox
Default Value: -><-

Inherited Class Variable Summary
Inherited From Class STPHPComponent
Variable Default Value Description
$attributes -><- The list of attributes
$components -><- The list of components
$configuration -><- The pointer to configuration XML node
$formParent -><- The form owner name
Inherited From Class STPHPObject
Variable Default Value Description
$name -><- The name of the object

Inherited Method Summary
Inherited From Class STPHPComponent
Function Description
constructor STPHPComponent ( [$name = ] ) Creates the object
addCodeFile ( $file ) Adds a code file (Javascript)
addComponent ( &$component ) Adds a component at the end of the components list
addCssFile ( $file ) Adds a CSS file
addVSpace ( $units ) Adds vertical spaces
appendAttributes ( $attributes ) Appends an array of attributes at the current values
appendComponent ( &$component ) Appends a component at the end of the components list
attributeIsEmpty ( $key ) Returns if attribute is empty
dtor ( ) Destructor
getAttribute ( $key ) Gets the value of an attribute
getFormParent ( ) Returns the form owner name
getTranslatedAttribute ( $key ) Translate an attribute to the current language
insertComponent ( &$component ) Inserts a component at the beginning of the components list
setAttribute ( $key, $val ) Sets an attribute
setConfiguration ( &$configuration ) Load the attributes from a STPHPXMLElement object
setFormParent ( $form ) Sets the form owner name of the component (used by JS functions)
translateAttribute ( $key ) Set an attribute to its translated value
write ( ) Designs the object at runtime
Inherited From Class STPHPObject
Function Description
constructor STPHPObject ( [$name = ] ) Creates the object
dtor ( ) Destructor
errorLog ( $message ) Print an error to the log system
getName ( ) Returns the name of the object

Method Summary
STPHPEdit constructor STPHPListbox ( $name )
Creates the object
void addElement ( $key, $value, [$selected = FALSE] )
Add an element at the listbox
void clearElements ( )
Clears the list of elements
void dtor ( )
Destructor
void loadFromDb ( &$db, $key_col, $val_col, $sql )
Load the elements from a db
void selectElementByKey ( $key )
Select an element by its key
void selectElementByValue ( $value )
Select an element by its value
void setConfiguration ( &$configuration )
string write ( )
Designs the object at runtime
Variable Detail

$elements

Data type: array
The list of elements of the listbox



Method Detail

constructor STPHPListbox

STPHPEdit constructor STPHPListbox ( $name )

Creates the object

Function Parameters:
- string $name:
Function Info:
Access - public

addElement

void addElement ( $key, $value, [$selected = FALSE] )

Add an element at the listbox

Function Parameters:
- string $key: the key of the element
- string $value: the value of the element
- bool $selected: the element is selected or not
Function Info:
Access - public

clearElements

void clearElements ( )

Clears the list of elements

Function Parameters:
Function Info:
Access - public

dtor

void dtor ( )

Overrides: STPHPComponent::dtor()

Destructor
Destroys all the resources associated with the object
Function Parameters:
Function Info:
Access - public

loadFromDb

void loadFromDb ( &$db, $key_col, $val_col, $sql )

Load the elements from a db

Function Parameters:
- string &$db: the db instance
- string $key_col: the column that containes the keys
- string $val_col: the column that containes the value
- string $sql: the sql that extracts the elements
Function Info:
Access - public

selectElementByKey

void selectElementByKey ( $key )

Select an element by its key

Function Parameters:
- string $key: the key of the element
Function Info:
Access - public

selectElementByValue

void selectElementByValue ( $value )

Select an element by its value

Function Parameters:
- string $value: the value of the element
Function Info:
Access - public

setConfiguration

void setConfiguration ( &$configuration )

Overrides: STPHPComponent::setConfiguration()


Function Parameters:
Function Info:

write

string write ( )

Overrides: STPHPComponent::write()

Designs the object at runtime
Available attributes :
- VISIBLE : defines if the component must be designed or not
- NAME : defines the name of the form (if empty $name of the object is used)
- READONLY : if 'TRUE' the control is readonly
- DISABLED : if 'TRUE' the control is disabled
- MULTIPLE: if 'TRUE' the multi selection is enabled
- SIZE: the number of rows showed
- ONCHANGE : defines the onchange event hook	
- CLASS : defines the CSS class
Function Parameters:
Function Info:
Return - the code that represents the object at runtime
Access - private