## Class TListItemCollection

Description

TListItemCollection class.

TListItemCollection maintains a list of TListItem for TListControl.

- since: 3.0
- version: $Revision: $ $Date: $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Web/UI/WebControls/TListControl.php (line 679)

    TComponent
       |
       --TList
          |
          --TListItemCollection

Method Summary
TListItem createListItem ([integer $index = -1])
integer findIndexByText (string $text, [boolean $includeDisabled = true])
integer findIndexByValue (string $value, [boolean $includeDisabled = true])
TListItem findItemByText (string $text, [boolean $includeDisabled = true])
TListItem findItemByValue (string $value, [boolean $includeDisabled = true])
void insertAt (integer $index, TListItem $item)
void loadState (array|null $state)
array|null saveState ()
Methods
createListItem (line 688)

Creates a list item object.

This method may be overriden to provide a customized list item object.

- return: list item object
- access: public

TListItem createListItem ([integer $index = -1])

- integer $index: index where the newly created item is to be inserted at. If -1, the item will be appended to the end.

findIndexByText (line 743)

Finds the lowest cardinal index of the item whose text is the one being looked for.

- return: the index of the item found, -1 if not found.
- access: public

integer findIndexByText (string $text, [boolean $includeDisabled = true])

- string $text: the text to be looked for
- boolean $includeDisabled: whether to look for disabled items also

findIndexByValue (line 724)

Finds the lowest cardinal index of the item whose value is the one being looked for.

- return: the index of the item found, -1 if not found.
- access: public

integer findIndexByValue (string $value, [boolean $includeDisabled = true])

- string $value: the value to be looked for
- boolean $includeDisabled: whether to look for disabled items also

findItemByText (line 776)

Finds the item whose text is the one being looked for.

- return: the item found, null if not found.
- access: public

TListItem findItemByText (string $text, [boolean $includeDisabled = true])

- string $text: the text to be looked for
- boolean $includeDisabled: whether to look for disabled items also

findItemByValue (line 762)

Finds the item whose value is the one being looked for.

- return: the item found, null if not found.
- access: public

TListItem findItemByValue (string $value, [boolean $includeDisabled = true])

- string $value: the value to be looked for
- boolean $includeDisabled: whether to look for disabled items also

insertAt (line 705)

Inserts an item into the collection.

- access: public
- throws: TInvalidDataTypeException if the item being inserted is neither a string nor TListItem

void insertAt (integer $index, TListItem $item)

- integer $index: the location where the item will be inserted. The current item at the place and the following ones will be moved backward.
- TListItem $item: the item to be inserted.

Redefinition of:

TList::insertAt()
  Inserts an item at the specified position.

loadState (line 789)

Loads state into every item in the collection.

This method should only be used by framework and control developers.

- access: public

void loadState (array|null $state)

- array|null $state: state to be loaded.

saveState (line 801)

Saves state of items.

This method should only be used by framework and control developers.

- return: the saved state
- access: public

array|null saveState ()

#### Inherited Methods

Inherited From TList

> TList::__construct()
> TList::add()
> TList::clear()
> TList::contains()
> TList::copyFrom()
> TList::getCount()
> TList::getIterator()
> TList::getReadOnly()
> TList::indexOf()
> TList::insertAt()
> TList::itemAt()
> TList::mergeWith()
> TList::offsetExists()
> TList::offsetGet()
> TList::offsetSet()
> TList::offsetUnset()
> TList::remove()
> TList::removeAt()
> TList::setReadOnly()
> TList::toArray()

Inherited From TComponent

> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> 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 Sun, 04 Jun 2006 18:59:48 -0400 by phpDocumentor 1.3.0RC4