## Class TListItem

Description

TListItem class.

TListItem represents an item in a list control. Each item has a Text property and a Value property. If either one of them is not set, it will take the value of the other property. An item can be Selected or Enabled, and it can have additional Attributes which may be rendered if the list control supports so.

- since: 3.0
- version: $Id: TListItem.php 1398 2006-09-08 19:31:03Z xue $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Web/UI/WebControls/TListItem.php (line 28)

    TComponent
       |
       --TListItem

Method Summary
TListItem __construct ([string $text = ''], [string $value = ''], [boolean $enabled = true], [boolean $selected = false])
string getAttribute (mixed $name)
TAttributeCollection getAttributes ()
boolean getEnabled ()
boolean getHasAttributes ()
boolean getSelected ()
string getText ()
string getValue ()
boolean hasAttribute (string $name)
string removeAttribute (string $name)
void setAttribute (string $name, string $value)
void setEnabled (boolean $value)
void setSelected (boolean $value)
void setText (string $value)
void setValue (string $value)
Methods
Constructor __construct (line 58)

Constructor.

- access: public

TListItem __construct ([string $text = ''], [string $value = ''], [boolean $enabled = true], [boolean $selected = false])

- string $text: text of the item
- string $value: value of the item
- boolean $enabled: whether the item is enabled
- boolean $selected: whether the item is selected

getAttribute (line 160)

- return: the named attribute value, null if attribute does not exist
- access: public

string getAttribute (mixed $name)
getAttributes (line 133)

- return: custom attributes
- access: public

TAttributeCollection getAttributes ()
getEnabled (line 69)

- return: whether the item is enabled
- access: public

boolean getEnabled ()
getHasAttributes (line 143)

- return: whether the item has any custom attribute
- access: public

boolean getHasAttributes ()
getSelected (line 85)

- return: whether the item is selected
- access: public

boolean getSelected ()
getText (line 101)

- return: text of the item
- access: public

string getText ()
getValue (line 117)

- return: value of the item
- access: public

string getValue ()
hasAttribute (line 152)

- return: whether the named attribute exists
- access: public

boolean hasAttribute (string $name)

- string $name: name of the attribute

removeAttribute (line 179)

Removes the named attribute.

- return: attribute value removed, empty string if attribute does not exist.
- access: public

string removeAttribute (string $name)

- string $name: the name of the attribute to be removed.

setAttribute (line 169)

- access: public

void setAttribute (string $name, string $value)

- string $name: attribute name
- string $value: value of the attribute

setEnabled (line 77)

- access: public

void setEnabled (boolean $value)

- boolean $value: whether the item is enabled

setSelected (line 93)

- access: public

void setSelected (boolean $value)

- boolean $value: whether the item is selected

setText (line 109)

- access: public

void setText (string $value)

- string $value: text of the item

setValue (line 125)

- access: public

void setValue (string $value)

- string $value: value of the item

#### Inherited Methods

Inherited From TComponent

> TComponent::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Documentation generated on Mon, 21 Apr 2008 11:35:30 -0400 by phpDocumentor 1.3.0RC4