## Class TDataList

Description

Implements interfaces:

- INamingContainer
- IRepeatInfoUser

TDataList class

TDataList represents a data bound and updatable list control.

Like TRepeater, TDataList displays its content repeatedly based on the data fetched from DataSource. The repeated contents in TDataList are called items, which are controls and can be accessed through Items. When dataBind() is invoked, TDataList creates an item for each row of data and binds the data row to the item. Optionally, a TDataList can have a header, a footer and/or separators between items.

TDataList differs from TRepeater in that it supports tiling the items in different manners and it maintains status of items to handle data update.

The layout of the repeated contents are specified by inline templates. TDataList items, header, footer, etc. are being instantiated with the corresponding templates when data is being bound to the repeater.

Since v3.1.0, the layout can also be by renderers. A renderer is a control class that can be instantiated as datalist items, header, etc. A renderer can thus be viewed as an external template (in fact, it can also be non-templated controls).

A renderer can be any control class.

- If the class implements IDataRenderer, the Data

property will be set as the data row during databinding. Many PRADO controls implement this interface, such as TLabel, TTextBox, etc.

- If the class implements IItemDataRenderer, the ItemIndex property will be set

as the zero-based index of the item in the datalist item collection, and the ItemType property as the item's type (such as TListItemType::Item). TDataListItemRenderer may be used as the convenient base class which already implements IDataItemRenderer.

The following properties are used to specify different types of template and renderer for a datalist:

- ItemTemplate, ItemRenderer:

for each repeated row of data

- AlternatingItemTemplate, AlternatingItemRenderer:

for each alternating row of data. If not set, ItemTemplate or ItemRenderer will be used instead.

- HeaderTemplate, HeaderRenderer:

for the datalist header.

- FooterTemplate, FooterRenderer:

for the datalist footer.

- SeparatorTemplate, SeparatorRenderer:

for content to be displayed between items.

- EmptyTemplate, EmptyRenderer:

used when data bound to the datalist is empty.

- EditItemTemplate, EditItemRenderer:

for the row being editted.

- SelectedItemTemplate, SelectedItemRenderer:

for the row being selected.

If a content type is defined with both a template and a renderer, the latter takes precedence.

When dataBind() is being called, TDataList undergoes the following lifecycles for each row of data:

- create item based on templates or renderers
- set the row of data to the item
- raise OnItemCreated:
- add the item as a child control
- call dataBind() of the item
- raise OnItemDataBound:

TDataList raises an OnItemCommand whenever a button control within some datalist item raises a OnCommand event. Therefore, you can handle all sorts of OnCommand event in a central place by writing an event handler for OnItemCommand.

An additional event is raised if the OnCommand event has one of the following command names:

- edit: user wants to edit an item. OnEditCommand event will be raised.
- update: user wants to save the change to an item. OnUpdateCommand event will be raised.
- select: user selects an item. OnSelectedIndexChanged event will be raised.
- delete: user deletes an item. OnDeleteCommand event will be raised.
- cancel: user cancels previously editting action. OnCancelCommand event will be raised.

TDataList provides a few properties to support tiling the items. The number of columns used to display the data items is specified via RepeatColumns property, while the RepeatDirection governs the order of the items being rendered. The layout of the data items in the list is specified via RepeatLayout, which can take one of the following values:

- Table (default): items are organized using HTML table and cells.

When using this layout, one can set CellPadding and CellSpacing to adjust the cellpadding and cellpadding of the table, and Caption and CaptionAlign to add a table caption with the specified alignment.

- Flow: items are organized using HTML spans and breaks.
- Raw: TDataList does not generate any HTML tags to do the tiling.

Items in TDataList can be in one of the three status: normal browsing, being editted and being selected. To change the status of a particular item, set SelectedItemIndex or EditItemIndex. The former will change the indicated item to selected mode, which will cause the item to use SelectedItemTemplate or SelectedItemRenderer for presentation. The latter will change the indicated item to edit mode and to use corresponding template or renderer. Note, if an item is in edit mode, then selecting this item will have no effect.

Different styles may be applied to items in different status. The style application is performed in a hierarchical way: Style in higher hierarchy will inherit from styles in lower hierarchy. Starting from the lowest hierarchy, the item styles include

- item's own style
- ItemStyle
- AlternatingItemStyle
- SelectedItemStyle
- EditItemStyle.

Therefore, if background color is set as red in ItemStyle, EditItemStyle will also have red background color unless it is set to a different value explicitly.

When a page containing a datalist is post back, the datalist will restore automatically all its contents, including items, header, footer and separators. However, the data row associated with each item will not be recovered and become null. To access the data, use one of the following ways:

- Use DataKeys to obtain the data key associated with

the specified datalist item and use the key to fetch the corresponding data from some persistent storage such as DB.

- Save the whole dataset in viewstate, which will restore the dataset automatically upon postback.

Be aware though, if the size of your dataset is big, your page size will become big. Some complex data may also have serializing problem if saved in viewstate.

- since: 3.0
- version: $Id: TDataList.php 2227 2007-09-17 12:56:51Z xue $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Web/UI/WebControls/TDataList.php (line 153)

    TComponent
       |
       --TApplicationComponent
          |
          --TControl
             |
             --TWebControl
                |
                --TDataBoundControl
                   |
                   --TBaseDataList
                      |
                      --TDataList

Class Constant Summary
CMD_CANCEL = 'Cancel'
CMD_DELETE = 'Delete'
CMD_EDIT = 'Edit'
CMD_SELECT = 'Select'
CMD_UPDATE = 'Update'
Method Summary
void applyItemStyles ()
boolean bubbleEvent (TControl $sender, TEventParameter $param)
void createEmptyContent ()
TControl createItem (integer $itemIndex, TListItemType $itemType)
TStyle generateItemStyle (string $itemType, integer $index)
string getAlternatingItemRenderer ()
TTableItemStyle getAlternatingItemStyle ()
ITemplate getAlternatingItemTemplate ()
string getCaption ()
TTableCaptionAlign getCaptionAlign ()
TControl getEditItem ()
integer getEditItemIndex ()
string getEditItemRenderer ()
TTableItemStyle getEditItemStyle ()
ITemplate getEditItemTemplate ()
string getEmptyRenderer ()
ITemplate getEmptyTemplate ()
TControl getFooter ()
string getFooterRenderer ()
TTableItemStyle getFooterStyle ()
ITemplate getFooterTemplate ()
boolean getHasFooter ()
boolean getHasHeader ()
boolean getHasSeparators ()
TControl getHeader ()
string getHeaderRenderer ()
TTableItemStyle getHeaderStyle ()
ITemplate getHeaderTemplate ()
integer getItemCount ()
string getItemRenderer ()
TDataListItemCollection getItems ()
TTableItemStyle getItemStyle ()
ITemplate getItemTemplate ()
integer getRepeatColumns ()
TRepeatDirection getRepeatDirection ()
TRepeatInfo getRepeatInfo ()
TRepeatLayout getRepeatLayout ()
mixed getSelectedDataKey ()
TControl getSelectedItem ()
integer getSelectedItemIndex ()
string getSelectedItemRenderer ()
TTableItemStyle getSelectedItemStyle ()
ITemplate getSelectedItemTemplate ()
string getSeparatorRenderer ()
TTableItemStyle getSeparatorStyle ()
ITemplate getSeparatorTemplate ()
boolean getShowFooter ()
boolean getShowHeader ()
void loadState ()
void onCancelCommand (TDataListCommandEventParameter $param)
void onDeleteCommand (TDataListCommandEventParameter $param)
void onEditCommand (TDataListCommandEventParameter $param)
void onItemCommand (TDataListCommandEventParameter $param)
void onItemCreated (TDataListItemEventParameter $param)
void onItemDataBound (TDataListItemEventParameter $param)
void onUpdateCommand (TDataListCommandEventParameter $param)
void performDataBinding (Traversable $data)
void render (THtmlWriter $writer)
void renderItem (THtmlWriter $writer, TRepeatInfo $repeatInfo, string $itemType, integer $index)
void reset ()
void restoreItemsFromViewState ()
void saveState ()
void setAlternatingItemRenderer (string $value)
void setAlternatingItemTemplate (ITemplate $value)
void setCaption (string $value)
TTableCaptionAlign setCaptionAlign (mixed $value)
void setEditItemIndex (integer $value)
void setEditItemRenderer (string $value)
void setEditItemTemplate (ITemplate $value)
void setEmptyRenderer (string $value)
void setEmptyTemplate (ITemplate $value)
void setFooterRenderer (string $value)
void setFooterTemplate (ITemplate $value)
void setHeaderRenderer (string $value)
void setHeaderTemplate (ITemplate $value)
void setItemRenderer (string $value)
void setItemTemplate (ITemplate $value)
void setRepeatColumns (integer $value)
void setRepeatDirection (TRepeatDirection $value)
void setRepeatLayout (TRepeatLayout $value)
void setSelectedItemIndex (integer $value)
void setSelectedItemRenderer (string $value)
void setSelectedItemTemplate (ITemplate $value)
void setSeparatorRenderer (string $value)
void setSeparatorTemplate (ITemplate $value)
void setShowFooter (boolean $value)
void setShowHeader (boolean $value)
Methods
applyItemStyles (line 1289)

Applies styles to items, header, footer and separators.

Item styles are applied in a hierarchical way. Style in higher hierarchy will inherit from styles in lower hierarchy. Starting from the lowest hierarchy, the item styles include item's own style, ItemStyle, AlternatingItemStyle, SelectedItemStyle, and EditItemStyle. Therefore, if background color is set as red in ItemStyle, EditItemStyle will also have red background color unless it is set to a different value explicitly.

- access: protected

void applyItemStyles ()
bubbleEvent (line 917)

This method overrides parent's implementation to handle onItemCommand event which is bubbled from datalist items and their child controls.

If the event parameter is TDataListCommandEventParameter and the command name is a recognized one, which includes 'select', 'edit', 'delete', 'update', and 'cancel' (case-insensitive), then a corresponding command event is also raised (such as OnEditCommand). This method should only be used by control developers.

- return: whether the event bubbling should stop here.
- access: public

boolean bubbleEvent (TControl $sender, TEventParameter $param)

- TControl $sender: the sender of the event
- TEventParameter $param: event parameter

Redefinition of:

TControl::bubbleEvent()
  This method responds to a bubbled event.

createEmptyContent (line 1270)

Creates empty datalist content.

- access: protected

void createEmptyContent ()
createItem (line 1211)

Creates a datalist item instance based on the item type and index.

- return: created datalist item
- access: protected

TControl createItem (integer $itemIndex, TListItemType $itemType)

- integer $itemIndex: zero-based item index
- TListItemType $itemType: item type

generateItemStyle (line 1076)

Returns a style used for rendering items.

This method is required by IRepeatInfoUser interface.

- return: item style
- access: public

TStyle generateItemStyle (string $itemType, integer $index)

- string $itemType: item type (Header,Footer,Item,AlternatingItem,SelectedItem,EditItem,Separator,Pager)
- integer $index: index of the item being rendered

getAlternatingItemRenderer (line 234)

- return: the class name for alternative datalist items. Defaults to empty, meaning not set.
- access: public
- since: 3.1.0

string getAlternatingItemRenderer ()
getAlternatingItemStyle (line 455)

- return: the style for each alternating item
- access: public

TTableItemStyle getAlternatingItemStyle ()
getAlternatingItemTemplate (line 435)

- return: the template for each alternating item
- access: public

ITemplate getAlternatingItemTemplate ()
getCaption (line 827)

- return: caption of the table layout
- access: public

string getCaption ()
getCaptionAlign (line 843)

- return: alignment of the caption of the table layout. Defaults to TTableCaptionAlign::NotSet.
- access: public

TTableCaptionAlign getCaptionAlign ()
getEditItem (line 769)

- return: the edit item
- access: public

TControl getEditItem ()
getEditItemIndex (line 739)

- return: the zero-based index of the edit item in Items. A value -1 means no item is in edit mode.
- access: public

integer getEditItemIndex ()
getEditItemRenderer (line 258)

- return: the class name for the datalist item being editted. Defaults to empty, meaning not set.
- access: public
- since: 3.1.0

string getEditItemRenderer ()
getEditItemStyle (line 521)

- return: the style for edit item
- access: public

TTableItemStyle getEditItemStyle ()
getEditItemTemplate (line 501)

- return: the edit item template
- access: public

ITemplate getEditItemTemplate ()
getEmptyRenderer (line 378)

- return: the class name for empty datalist item. Defaults to empty, meaning not set.
- access: public
- since: 3.1.0

string getEmptyRenderer ()
getEmptyTemplate (line 616)

- return: the template applied when no data is bound to the datalist
- access: public

ITemplate getEmptyTemplate ()
getFooter (line 608)

- return: the footer item
- access: public

TControl getFooter ()
getFooterRenderer (line 354)

- return: the class name for datalist footer item. Defaults to empty, meaning not set.
- access: public
- since: 3.1.0

string getFooterRenderer ()
getFooterStyle (line 595)

- return: the style for footer
- access: public

TTableItemStyle getFooterStyle ()
getFooterTemplate (line 575)

- return: the footer template
- access: public

ITemplate getFooterTemplate ()
getHasFooter (line 1054)

Returns a value indicating whether this control contains footer item.

This method is required by IRepeatInfoUser interface.

- return: whether the datalist has footer
- access: public

boolean getHasFooter ()
getHasHeader (line 1044)

Returns a value indicating whether this control contains header item.

This method is required by IRepeatInfoUser interface.

- return: whether the datalist has header
- access: public

boolean getHasHeader ()
getHasSeparators (line 1064)

Returns a value indicating whether this control contains separator items.

This method is required by IRepeatInfoUser interface.

- return: always false.
- access: public

boolean getHasSeparators ()
getHeader (line 567)

- return: the header item
- access: public

TControl getHeader ()
getHeaderRenderer (line 330)

- return: the class name for datalist header item. Defaults to empty, meaning not set.
- access: public
- since: 3.1.0

string getHeaderRenderer ()
getHeaderStyle (line 554)

- return: the style for header
- access: public

TTableItemStyle getHeaderStyle ()
getHeaderTemplate (line 534)

- return: the header template
- access: public

ITemplate getHeaderTemplate ()
getItemCount (line 201)

- return: number of items
- access: public

integer getItemCount ()
getItemRenderer (line 210)

- return: the class name for datalist items. Defaults to empty, meaning not set.
- access: public
- since: 3.1.0

string getItemRenderer ()
getItems (line 191)

- return: item list
- access: public

TDataListItemCollection getItems ()
getItemStyle (line 422)

- return: the style for item
- access: public

TTableItemStyle getItemStyle ()
getItemTemplate (line 402)

- return: the template for item
- access: public

ITemplate getItemTemplate ()
getRepeatColumns (line 859)

- return: the number of columns that the list should be displayed with. Defaults to 0 meaning not set.
- access: public

integer getRepeatColumns ()
getRepeatDirection (line 875)

- return: the direction of traversing the list, defaults to TRepeatDirection::Vertical
- access: public

TRepeatDirection getRepeatDirection ()
getRepeatInfo (line 814)

- return: repeat information (primarily used by control developers)
- access: protected

TRepeatInfo getRepeatInfo ()
getRepeatLayout (line 891)

- return: how the list should be displayed, using table or using line breaks. Defaults to TRepeatLayout::Table.
- access: public

TRepeatLayout getRepeatLayout ()
getSelectedDataKey (line 723)

- return: the key value of the currently selected item
- access: public
- throws: TInvalidOperationException if DataKeyField is empty.

mixed getSelectedDataKey ()
getSelectedItem (line 709)

- return: the selected item, null if no item is selected.
- access: public

TControl getSelectedItem ()
getSelectedItemIndex (line 670)

- return: the zero-based index of the selected item in Items. A value -1 means no item selected.
- access: public

integer getSelectedItemIndex ()
getSelectedItemRenderer (line 282)

- return: the class name for the datalist item being selected. Defaults to empty, meaning not set.
- access: public
- since: 3.1.0

string getSelectedItemRenderer ()
getSelectedItemStyle (line 488)

- return: the style for selected item
- access: public

TTableItemStyle getSelectedItemStyle ()
getSelectedItemTemplate (line 468)

- return: the selected item template
- access: public

ITemplate getSelectedItemTemplate ()
getSeparatorRenderer (line 306)

- return: the class name for datalist item separators. Defaults to empty, meaning not set.
- access: public
- since: 3.1.0

string getSeparatorRenderer ()
getSeparatorStyle (line 656)

- return: the style for separator
- access: public

TTableItemStyle getSeparatorStyle ()
getSeparatorTemplate (line 636)

- return: the separator template
- access: public

ITemplate getSeparatorTemplate ()
getShowFooter (line 798)

- return: whether the footer should be shown. Defaults to true.
- access: public

boolean getShowFooter ()
getShowHeader (line 782)

- return: whether the header should be shown. Defaults to true.
- access: public

boolean getShowHeader ()
loadState (line 1375)

Loads item count information from viewstate.

This method is invoked right after control state is loaded.

- access: public

void loadState ()

Redefinition of:

TControl::loadState()
  This method is invoked right after the control has loaded its state.

onCancelCommand (line 1034)

Raises OnCancelCommand event.

This method is invoked when a child control of the data list raises an OnCommand event and the command name is 'cancel' (case-insensitive).

- access: public

void onCancelCommand (TDataListCommandEventParameter $param)

- TDataListCommandEventParameter $param: event parameter

onDeleteCommand (line 1012)

Raises OnDeleteCommand event.

This method is invoked when a child control of the data list raises an OnCommand event and the command name is 'delete' (case-insensitive).

- access: public

void onDeleteCommand (TDataListCommandEventParameter $param)

- TDataListCommandEventParameter $param: event parameter

onEditCommand (line 1001)

Raises OnEditCommand event.

This method is invoked when a child control of the data list raises an OnCommand event and the command name is 'edit' (case-insensitive).

- access: public

void onEditCommand (TDataListCommandEventParameter $param)

- TDataListCommandEventParameter $param: event parameter

onItemCommand (line 990)

Raises OnItemCommand event.

This method is invoked when a child control of the data list raises an OnCommand event.

- access: public

void onItemCommand (TDataListCommandEventParameter $param)

- TDataListCommandEventParameter $param: event parameter

onItemCreated (line 965)

Raises OnItemCreated event.

This method is invoked after a data list item is created and instantiated with template, but before added to the page hierarchy. The datalist item control responsible for the event can be determined from the event parameter. If you override this method, be sure to call parent's implementation so that event handlers have chance to respond to the event.

- access: public

void onItemCreated (TDataListItemEventParameter $param)

- TDataListItemEventParameter $param: event parameter

onItemDataBound (line 979)

Raises OnItemDataBound event.

This method is invoked right after an item is data bound. The datalist item control responsible for the event can be determined from the event parameter. If you override this method, be sure to call parent's implementation so that event handlers have chance to respond to the event.

- access: public

void onItemDataBound (TDataListItemEventParameter $param)

- TDataListItemEventParameter $param: event parameter

onUpdateCommand (line 1023)

Raises OnUpdateCommand event.

This method is invoked when a child control of the data list raises an OnCommand event and the command name is 'update' (case-insensitive).

- access: public

void onUpdateCommand (TDataListCommandEventParameter $param)

- TDataListCommandEventParameter $param: event parameter

performDataBinding (line 1432)

Performs databinding to populate data list items from data source.

This method is invoked by dataBind(). You may override this function to provide your own way of data population.

- access: protected

void performDataBinding (Traversable $data)

- Traversable $data: the data

Redefinition of:

TDataBoundControl::performDataBinding()

render (line 1477)

Renders the data list control.

This method overrides the parent implementation.

- access: public

void render (THtmlWriter $writer)

- THtmlWriter $writer: writer for rendering purpose.

Redefinition of:

TWebControl::render()
  Renders the control.

renderItem (line 1096)

Renders an item in the list.

This method is required by IRepeatInfoUser interface.

- access: public

void renderItem (THtmlWriter $writer, TRepeatInfo $repeatInfo, string $itemType, integer $index)

- THtmlWriter $writer: writer for rendering purpose
- TRepeatInfo $repeatInfo: repeat information
- string $itemType: item type (Header,Footer,Item,AlternatingItem,SelectedItem,EditItem,Separator,Pager)
- integer $index: zero-based index of the item in the item list

reset (line 1386)

Clears up all items in the data list.

- access: public

void reset ()
restoreItemsFromViewState (line 1397)

Creates data list items based on viewstate information.

- access: protected

void restoreItemsFromViewState ()
saveState (line 1362)

Saves item count in viewstate.

This method is invoked right before control state is to be saved.

- access: public

void saveState ()

Redefinition of:

TControl::saveState()
  This method is invoked when control state is to be saved.

setAlternatingItemRenderer (line 249)

Sets the alternative item renderer class.

If not empty, the class will be used to instantiate as alternative datalist items. This property takes precedence over AlternatingItemTemplate.

- access: public
- since: 3.1.0
- see: TDataList::setAlternatingItemTemplate()

void setAlternatingItemRenderer (string $value)

- string $value: the renderer class name in namespace format.

setAlternatingItemTemplate (line 444)

- access: public
- throws: TInvalidDataTypeException if the input is not an ITemplate or not null.

void setAlternatingItemTemplate (ITemplate $value)

- ITemplate $value: the template for each alternating item

setCaption (line 835)

- access: public

void setCaption (string $value)

- string $value: caption of the table layout

setCaptionAlign (line 851)

- return: alignment of the caption of the table layout.
- access: public

TTableCaptionAlign setCaptionAlign (mixed $value)
setEditItemIndex (line 750)

Edits an item by its index in getItems.

Previously editting item will change to normal item state. If the index is less than 0, any existing edit item will be cleared up.

- access: public

void setEditItemIndex (integer $value)

- integer $value: the edit item index

setEditItemRenderer (line 273)

Sets the renderer class for the datalist item being editted.

If not empty, the class will be used to instantiate as the datalist item. This property takes precedence over EditItemTemplate.

- access: public
- since: 3.1.0
- see: TDataList::setEditItemTemplate()

void setEditItemRenderer (string $value)

- string $value: the renderer class name in namespace format.

setEditItemTemplate (line 510)

- access: public
- throws: TInvalidDataTypeException if the input is not an ITemplate or not null.

void setEditItemTemplate (ITemplate $value)

- ITemplate $value: the edit item template

setEmptyRenderer (line 394)

Sets the datalist empty renderer class.

The empty renderer is created as the child of the datalist if data bound to the datalist is empty. This property takes precedence over EmptyTemplate.

- access: public
- since: 3.1.0
- see: TDataList::setEmptyTemplate()

void setEmptyRenderer (string $value)

- string $value: the renderer class name in namespace format.

setEmptyTemplate (line 625)

- access: public
- throws: TInvalidDataTypeException if the input is not an ITemplate or not null.

void setEmptyTemplate (ITemplate $value)

- ITemplate $value: the template applied when no data is bound to the datalist

setFooterRenderer (line 369)

Sets the datalist footer renderer class.

If not empty, the class will be used to instantiate as datalist footer item. This property takes precedence over FooterTemplate.

- access: public
- since: 3.1.0
- see: TDataList::setFooterTemplate()

void setFooterRenderer (string $value)

- string $value: the renderer class name in namespace format.

setFooterTemplate (line 584)

- access: public
- throws: TInvalidDataTypeException if the input is not an ITemplate or not null.

void setFooterTemplate (ITemplate $value)

- ITemplate $value: the footer template

setHeaderRenderer (line 345)

Sets the datalist header renderer class.

If not empty, the class will be used to instantiate as datalist header item. This property takes precedence over HeaderTemplate.

- access: public
- since: 3.1.0
- see: TDataList::setHeaderTemplate()

void setHeaderRenderer (string $value)

- string $value: the renderer class name in namespace format.

setHeaderTemplate (line 543)

- access: public
- throws: TInvalidDataTypeException if the input is not an ITemplate or not null.

void setHeaderTemplate (ITemplate $value)

- ITemplate $value: the header template

setItemRenderer (line 225)

Sets the item renderer class.

If not empty, the class will be used to instantiate as datalist items. This property takes precedence over ItemTemplate.

- access: public
- since: 3.1.0
- see: TDataList::setItemTemplate()

void setItemRenderer (string $value)

- string $value: the renderer class name in namespace format.

setItemTemplate (line 411)

- access: public
- throws: TInvalidDataTypeException if the input is not an ITemplate or not null.

void setItemTemplate (ITemplate $value)

- ITemplate $value: the template for item

setRepeatColumns (line 867)

- access: public

void setRepeatColumns (integer $value)

- integer $value: the number of columns that the list should be displayed with.

setRepeatDirection (line 883)

- access: public

void setRepeatDirection (TRepeatDirection $value)

- TRepeatDirection $value: the direction of traversing the list

setRepeatLayout (line 899)

- access: public

void setRepeatLayout (TRepeatLayout $value)

- TRepeatLayout $value: how the list should be displayed, using table or using line breaks

setSelectedItemIndex (line 682)

Selects an item by its index in getItems.

Previously selected item will be un-selected. If the item to be selected is already in edit mode, it will remain in edit mode. If the index is less than 0, any existing selection will be cleared up.

- access: public

void setSelectedItemIndex (integer $value)

- integer $value: the selected item index

setSelectedItemRenderer (line 297)

Sets the renderer class for the datalist item being selected.

If not empty, the class will be used to instantiate as the datalist item. This property takes precedence over SelectedItemTemplate.

- access: public
- since: 3.1.0
- see: TDataList::setSelectedItemTemplate()

void setSelectedItemRenderer (string $value)

- string $value: the renderer class name in namespace format.

setSelectedItemTemplate (line 477)

- access: public
- throws: TInvalidDataTypeException if the input is not an ITemplate or not null.

void setSelectedItemTemplate (ITemplate $value)

- ITemplate $value: the selected item template

setSeparatorRenderer (line 321)

Sets the datalist item separator renderer class.

If not empty, the class will be used to instantiate as datalist item separators. This property takes precedence over SeparatorTemplate.

- access: public
- since: 3.1.0
- see: TDataList::setSeparatorTemplate()

void setSeparatorRenderer (string $value)

- string $value: the renderer class name in namespace format.

setSeparatorTemplate (line 645)

- access: public
- throws: TInvalidDataTypeException if the input is not an ITemplate or not null.

void setSeparatorTemplate (ITemplate $value)

- ITemplate $value: the separator template

setShowFooter (line 806)

- access: public

void setShowFooter (boolean $value)

- boolean $value: whether to show footer

setShowHeader (line 790)

- access: public

void setShowHeader (boolean $value)

- boolean $value: whether to show header

#### Inherited Methods

Inherited From TBaseDataList

> TBaseDataList::createStyle()
> TBaseDataList::getCellPadding()
> TBaseDataList::getCellSpacing()
> TBaseDataList::getDataFieldValue()
> TBaseDataList::getDataKeyField()
> TBaseDataList::getDataKeys()
> TBaseDataList::getGridLines()
> TBaseDataList::getHorizontalAlign()
> TBaseDataList::onSelectedIndexChanged()
> TBaseDataList::setCellPadding()
> TBaseDataList::setCellSpacing()
> TBaseDataList::setDataKeyField()
> TBaseDataList::setGridLines()
> TBaseDataList::setHorizontalAlign()

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()

Class Constants
CMD_CANCEL = 'Cancel' (line 162)
CMD_DELETE = 'Delete' (line 161)
CMD_EDIT = 'Edit' (line 159)
CMD_SELECT = 'Select' (line 158)

Command name that TDataList understands. They are case-insensitive.

CMD_UPDATE = 'Update' (line 160)

#### Inherited Constants

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 Sun, 30 Sep 2007 19:15:39 -0400 by phpDocumentor 1.3.0RC4