Implements interfaces:
TListControl class
TListControl is a base class for list controls, such as TListBox, TDropDownList, TCheckBoxList, etc. It manages the items and their status in a list control. It also implements how the items can be populated from template and data source.
The property getItems returns a list of the items in the control. To specify or determine which item is selected, use the SelectedIndex property that indicates the zero-based index of the selected item in the item list. You may also use SelectedItem and SelectedValue to get the selected item and its value. For multiple selection lists (such as TCheckBoxList and TListBox), property SelectedIndices is useful.
TListControl implements AutoPostBack which allows a list control to postback the page if the selections of the list items are changed. The CausesValidation and ValidationGroup properties may be used to specify that validation be performed when auto postback occurs.
There are three ways to populate the items in a list control: from template, using DataSource and using DataSourceID. The latter two are covered in TDataBoundControl. To specify items via template, using the following template syntax:
- <com:TListControl>
- <com:TListItem Value="xxx" Text="yyy" >
- <com:TListItem Value="xxx" Text="yyy" Selected="true" >
- <com:TListItem Value="xxx" Text="yyy" >
- </com:TListControl>
When DataSource or DataSourceID is used to populate list items, the DataTextField and DataValueField properties are used to specify which columns of the data will be used to populate the text and value of the items. For example, if a data source is as follows,
setting DataTextField and DataValueField to 'name' and 'age' will make the first item's text be 'John', value be 31, the second item's text be 'Cary', value be 28, and so on. The DataTextFormatString property may be further used to format how the item should be displayed. See formatDataValue() for an explanation of the format string.
- $dataSource=array(
- array('name'=>'John', 'age'=>31),
- array('name'=>'Cary', 'age'=>28),
- array('name'=>'Rose', 'age'=>35),
- );
Located in /Web/UI/WebControls/TListControl.php (line 81)
TComponent | --TApplicationComponent | --TControl | --TWebControl | --TDataBoundControl | --TListControl
Class | Description |
---|---|
TBulletedList | TBulletedList class |
TCheckBoxList | TCheckBoxList class |
TDropDownList | TDropDownList class |
TListBox | TListBox class |
Adds attributes to renderer.
Adds object parsed from template to the control.
This method adds only TListItem objects into the Items collection. All other objects are ignored.
Clears all existing selections.
Creates a collection object to hold list items.
This method may be overriden to create a customized collection.
Formats the text value according to a format string.
If the format string is empty, the original value is converted into a string and returned. If the format string starts with '#', the string is treated as a PHP expression within which the token '{0}' is translated with the data value to be formated. Otherwise, the format string and the data value are passed as the first and second parameters in http://www.php.net/sprintf.
Gets the name of the javascript class responsible for performing postback for this control.
Derived classes may override this method and return customized js class names.
Returns the value of the selected item with the lowest cardinal index.
This method is required by IDataRenderer. It is the same as getSelectedValue().
Loads items from viewstate.
This method is invoked right after control state is loaded.
Raises OnSelectedIndexChanged event when selection is changed.
This method is invoked when the list control has its selection changed by end-users.
Raises OnTextChanged event when selection is changed.
This method is invoked when the list control has its selection changed by end-users.
Performs databinding to populate list items from data source.
This method is invoked by dataBind(). You may override this function to provide your own way of data population.
Renders the javascript for list control.
Renders body content of the list control.
This method renders items contained in the list control as the body content.
Saves items into viewstate.
This method is invoked right before control state is to be saved.
Sets the value indicating if postback automatically.
An automatic postback to the server will occur whenever the user makes change to the list control and then tabs out of it.
Selects an item by the specified value.
This method is required by IDataRenderer. It is the same as setSelectedValue().
Sets data text format string.
The format string is used in TDataValueFormatter::format() to format the Text property value of each item in the list control.
Sets selection by item value.
Existing selections will be cleared if the item value is found in the item collection. Note, if the value is null, existing selections will also be cleared.
Inherited From TDataBoundControl
TDataBoundControl::createPagedDataSource()
TDataBoundControl::dataBind()
TDataBoundControl::dataSourceViewChanged()
TDataBoundControl::determineDataSource()
TDataBoundControl::ensureDataBound()
TDataBoundControl::getAllowCustomPaging()
TDataBoundControl::getAllowPaging()
TDataBoundControl::getCurrentPageIndex()
TDataBoundControl::getDataMember()
TDataBoundControl::getDataSource()
TDataBoundControl::getDataSourceID()
TDataBoundControl::getDataSourceView()
TDataBoundControl::getInitialized()
TDataBoundControl::getIsDataBound()
TDataBoundControl::getPageCount()
TDataBoundControl::getPageSize()
TDataBoundControl::getRequiresDataBinding()
TDataBoundControl::getSelectParameters()
TDataBoundControl::getUsingDataSourceID()
TDataBoundControl::getVirtualItemCount()
TDataBoundControl::onDataBound()
TDataBoundControl::onDataSourceChanged()
TDataBoundControl::onInit()
TDataBoundControl::onPreRender()
TDataBoundControl::pagePreLoad()
TDataBoundControl::performDataBinding()
TDataBoundControl::setAllowCustomPaging()
TDataBoundControl::setAllowPaging()
TDataBoundControl::setCurrentPageIndex()
TDataBoundControl::setDataMember()
TDataBoundControl::setDataSource()
TDataBoundControl::setDataSourceID()
TDataBoundControl::setInitialized()
TDataBoundControl::setIsDataBound()
TDataBoundControl::setPageSize()
TDataBoundControl::setRequiresDataBinding()
TDataBoundControl::setVirtualItemCount()
TDataBoundControl::validateDataSource()
Inherited From TWebControl
TWebControl::addAttributesToRender()
TWebControl::clearStyle()
TWebControl::copyBaseAttributes()
TWebControl::createStyle()
TWebControl::getAccessKey()
TWebControl::getBackColor()
TWebControl::getBorderColor()
TWebControl::getBorderStyle()
TWebControl::getBorderWidth()
TWebControl::getCssClass()
TWebControl::getDisplay()
TWebControl::getFont()
TWebControl::getForeColor()
TWebControl::getHasStyle()
TWebControl::getHeight()
TWebControl::getStyle()
TWebControl::getTabIndex()
TWebControl::getTagName()
TWebControl::getToolTip()
TWebControl::getWidth()
TWebControl::render()
TWebControl::renderBeginTag()
TWebControl::renderContents()
TWebControl::renderEndTag()
TWebControl::setAccessKey()
TWebControl::setBackColor()
TWebControl::setBorderColor()
TWebControl::setBorderStyle()
TWebControl::setBorderWidth()
TWebControl::setCssClass()
TWebControl::setDisplay()
TWebControl::setForeColor()
TWebControl::setHeight()
TWebControl::setStyle()
TWebControl::setTabIndex()
TWebControl::setToolTip()
TWebControl::setWidth()
Inherited From TControl
TControl::__construct()
TControl::addedControl()
TControl::addParsedObject()
TControl::addToPostDataLoader()
TControl::applyStyleSheetSkin()
TControl::autoBindProperty()
TControl::autoDataBindProperties()
TControl::bindProperty()
TControl::broadcastEvent()
TControl::bubbleEvent()
TControl::clearChildState()
TControl::clearControlState()
TControl::clearNamingContainer()
TControl::clearViewState()
TControl::convertUniqueIdToClientId()
TControl::createChildControls()
TControl::createControlCollection()
TControl::dataBind()
TControl::dataBindChildren()
TControl::dataBindProperties()
TControl::ensureChildControls()
TControl::findControl()
TControl::findControlsByID()
TControl::findControlsByType()
TControl::focus()
TControl::getAdapter()
TControl::getAllowChildControls()
TControl::getAttribute()
TControl::getAttributes()
TControl::getChildControlsCreated()
TControl::getClientID()
TControl::getControls()
TControl::getControlStage()
TControl::getControlState()
TControl::getCustomData()
TControl::getEnabled()
TControl::getEnableTheming()
TControl::getEnableViewState()
TControl::getHasAdapter()
TControl::getHasAttributes()
TControl::getHasChildInitialized()
TControl::getHasControls()
TControl::getHasInitialized()
TControl::getHasLoaded()
TControl::getHasLoadedPostData()
TControl::getHasPreRendered()
TControl::getID()
TControl::getNamingContainer()
TControl::getPage()
TControl::getParent()
TControl::getRegisteredObject()
TControl::getSkinID()
TControl::getSourceTemplateControl()
TControl::getTemplateControl()
TControl::getUniqueID()
TControl::getViewState()
TControl::getVisible()
TControl::hasAttribute()
TControl::initRecursive()
TControl::isDescendentOf()
TControl::isObjectRegistered()
TControl::loadRecursive()
TControl::loadState()
TControl::loadStateRecursive()
TControl::onDataBinding()
TControl::onInit()
TControl::onLoad()
TControl::onPreRender()
TControl::onUnload()
TControl::preRenderRecursive()
TControl::raiseBubbleEvent()
TControl::registerObject()
TControl::removeAttribute()
TControl::removedControl()
TControl::render()
TControl::renderChildren()
TControl::renderControl()
TControl::saveState()
TControl::saveStateRecursive()
TControl::setAdapter()
TControl::setAttribute()
TControl::setChildControlsCreated()
TControl::setControlStage()
TControl::setControlState()
TControl::setCustomData()
TControl::setEnabled()
TControl::setEnableTheming()
TControl::setEnableViewState()
TControl::setID()
TControl::setPage()
TControl::setSkinID()
TControl::setTemplateControl()
TControl::setViewState()
TControl::setVisible()
TControl::trackViewState()
TControl::traverseChildControls()
TControl::unbindProperty()
TControl::unloadRecursive()
TControl::unregisterObject()
TControl::__get()
Inherited From TApplicationComponent
TApplicationComponent::getApplication()
TApplicationComponent::getRequest()
TApplicationComponent::getResponse()
TApplicationComponent::getService()
TApplicationComponent::getSession()
TApplicationComponent::getUser()
TApplicationComponent::publishAsset()
TApplicationComponent::publishFilePath()
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()
Inherited from TControl
TControl::AUTOMATIC_ID_PREFIX
TControl::CLIENT_ID_SEPARATOR
TControl::CS_CHILD_INITIALIZED
TControl::CS_CONSTRUCTED
TControl::CS_INITIALIZED
TControl::CS_LOADED
TControl::CS_PRERENDERED
TControl::CS_STATE_LOADED
TControl::ID_FORMAT
TControl::ID_SEPARATOR
TControl::IS_CHILD_CREATED
TControl::IS_CREATING_CHILD
TControl::IS_DISABLE_THEMING
TControl::IS_DISABLE_VIEWSTATE
TControl::IS_ID_SET
TControl::IS_SKIN_APPLIED
TControl::IS_STYLESHEET_APPLIED
TControl::RF_ADAPTER
TControl::RF_AUTO_BINDINGS
TControl::RF_CHILD_STATE
TControl::RF_CONTROLS
TControl::RF_CONTROLSTATE
TControl::RF_DATA_BINDINGS
TControl::RF_EVENTS
TControl::RF_NAMED_CONTROLS
TControl::RF_NAMED_CONTROLS_ID
TControl::RF_NAMED_OBJECTS
TControl::RF_SKIN_ID
Documentation generated on Mon, 21 Apr 2008 11:35:27 -0400 by phpDocumentor 1.3.0RC4