## Class TCheckBoxList

Description

Implements interfaces:

- IRepeatInfoUser
- INamingContainer
- IPostBackDataHandler
- IValidatable

TCheckBoxList class

TCheckBoxList displays a list of checkboxes on a Web page.

The layout of the checkbox list is specified via RepeatLayout, which can be either 'Table' (default) or 'Flow'. A table layout uses HTML table cells to organize the checkboxes while a flow layout uses line breaks to organize the checkboxes. When the layout is using 'Table', CellPadding and CellSpacing can be used to adjust the cellpadding and cellpadding of the table.

The number of columns used to display the checkboxes is specified via RepeatColumns property, while the RepeatDirection governs the order of the items being rendered.

The alignment of the text besides each checkbox can be specified via TextAlign.

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

Located in /Web/UI/WebControls/TCheckBoxList.php (line 50)

    TComponent
       |
       --TApplicationComponent
          |
          --TControl
             |
             --TWebControl
                |
                --TDataBoundControl
                   |
                   --TListControl
                      |
                      --TCheckBoxList

Direct descendents

Class | Description
--- | ---
TRadioButtonList | TRadioButtonList class

Method Summary
TCheckBoxList __construct ()
TControl createRepeatedControl ()
TStyle createStyle ()
TControl findControl (string $id)
null generateItemStyle (string $itemType, integer $index)
integer getCellPadding ()
integer getCellSpacing ()
boolean getHasFooter ()
boolean getHasHeader ()
boolean getHasSeparators ()
boolean getIsMultiSelect ()
integer getRepeatColumns ()
string getRepeatDirection ()
TRepeatInfo getRepeatInfo ()
string getRepeatLayout ()
string getTextAlign ()
mixed getValidationPropertyValue ()
boolean loadPostData (string $key, array $values)
void onPreRender (mixed $param)
void raisePostDataChangedEvent ()
void render (THtmlWriter $writer)
void renderItem (THtmlWriter $writer, TRepeatInfo $repeatInfo, string $itemType, integer $index)
void setCellPadding (integer $value)
void setCellSpacing (integer $value)
void setRepeatColumns (integer $value)
void setRepeatDirection (string $value)
void setRepeatLayout (string $value)
void setTextAlign (string $value)
Methods
Constructor __construct (line 60)

Constructor.

Remember to call parent implementation if you override this method

- access: public

TCheckBoxList __construct ()

Redefinition of:

TControl::__construct()
  Constructor.

Redefined in descendants as:

- TRatingList::__construct()

createRepeatedControl (line 73)

Creates a control used for repetition (used as a template).

- return: the control to be repeated
- access: protected

TControl createRepeatedControl ()

Redefined in descendants as:

- TRadioButtonList::createRepeatedControl() : Creates a control used for repetition (used as a template).

createStyle (line 103)

Creates a style object for the control.

This method creates a TTableStyle to be used by checkbox list.

- return: control style to be used
- access: protected

TStyle createStyle ()

Redefinition of:

TWebControl::createStyle()
  Creates a style object to be used by the control.

findControl (line 85)

Finds a control by ID.

This method overrides the parent implementation so that it always returns the checkbox list itself (because the checkbox list does not have child controls.)

- return: control being found
- access: public

TControl findControl (string $id)

- string $id: control ID

Redefinition of:

TControl::findControl()
  Finds a control by ID path within the current naming container.

generateItemStyle (line 264)

Returns a style used for rendering items.

This method is required by IRepeatInfoUser interface.

- access: public

null 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

Redefined in descendants as:

- TRatingList::generateItemStyle()

getCellPadding (line 210)

- return: the cellpadding for the table keeping the checkbox list. Defaults to -1, meaning not set.
- access: public

integer getCellPadding ()
getCellSpacing (line 190)

- return: the cellspacing for the table keeping the checkbox list. Defaults to -1, meaning not set.
- access: public

integer getCellSpacing ()
getHasFooter (line 242)

Returns a value indicating whether this control contains footer item.

This method is required by IRepeatInfoUser interface.

- return: always false.
- access: public

boolean getHasFooter ()
getHasHeader (line 232)

Returns a value indicating whether this control contains header item.

This method is required by IRepeatInfoUser interface.

- return: always false.
- access: public

boolean getHasHeader ()
getHasSeparators (line 252)

Returns a value indicating whether this control contains separator items.

This method is required by IRepeatInfoUser interface.

- return: always false.
- access: public

boolean getHasSeparators ()
getIsMultiSelect (line 93)

- return: whether this control supports multiple selection. Always true for checkbox list.
- access: protected

boolean getIsMultiSelect ()

Redefinition of:

TListControl::getIsMultiSelect()

Redefined in descendants as:

- TRadioButtonList::getIsMultiSelect()

getRepeatColumns (line 142)

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

integer getRepeatColumns ()
getRepeatDirection (line 158)

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

string getRepeatDirection ()
getRepeatInfo (line 129)

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

TRepeatInfo getRepeatInfo ()
getRepeatLayout (line 174)

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

string getRepeatLayout ()
getTextAlign (line 111)

- return: the alignment of the text caption, defaults to 'Right'.
- access: public

string getTextAlign ()
getValidationPropertyValue (line 390)

Returns the value to be validated.

This methid is required by IValidatable interface.

- return: the value of the property to be validated.
- access: public

mixed getValidationPropertyValue ()
loadPostData (line 300)

Loads user input data.

This method is primarly used by framework developers.

- return: whether the data of the control has been changed
- access: public

boolean loadPostData (string $key, array $values)

- string $key: the key that can be used to retrieve data from the input data collection
- array $values: the input data collection

Redefined in descendants as:

- TRadioButtonList::loadPostData() : Loads user input data.

onPreRender (line 346)

Registers for post data on postback.

This method overrides the parent implementation.

- access: public

void onPreRender (mixed $param)

- mixed $param: event parameter

Redefinition of:

TDataBoundControl::onPreRender()
  Ensures any pending databind is performed.

Redefined in descendants as:

- TRatingList::onPreRender()

raisePostDataChangedEvent (line 334)

Raises postdata changed event.

This method is required by IPostBackDataHandler interface. It is invoked by the framework when SelectedIndices property is changed on postback. This method is primarly used by framework developers.

- access: public

void raisePostDataChangedEvent ()
render (line 366)

Renders the checkbox 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 277)

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

Redefined in descendants as:

- TRatingList::renderItem()

setCellPadding (line 222)

Sets the cellpadding for the table keeping the checkbox list.

- access: public

void setCellPadding (integer $value)

- integer $value: the cellpadding for the table keeping the checkbox list.

setCellSpacing (line 202)

Sets the cellspacing for the table keeping the checkbox list.

- access: public

void setCellSpacing (integer $value)

- integer $value: the cellspacing for the table keeping the checkbox list.

setRepeatColumns (line 150)

- access: public

void setRepeatColumns (integer $value)

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

setRepeatDirection (line 166)

- access: public

void setRepeatDirection (string $value)

- string $value: the direction (Vertical, Horizontal) of traversing the list

setRepeatLayout (line 182)

- access: public

void setRepeatLayout (string $value)

- string $value: how the list should be displayed, using table or using line breaks (Table, Flow)

setTextAlign (line 120)

Sets the text alignment of the checkboxes

- access: public

void setTextAlign (string $value)

- string $value: either 'Left' or 'Right'

#### Inherited Methods

Inherited From TListControl

> TListControl::addAttributesToRender()
> TListControl::addParsedObject()
> TListControl::clearSelection()
> TListControl::formatDataValue()
> TListControl::getAppendDataBoundItems()
> TListControl::getAutoPostBack()
> TListControl::getCausesValidation()
> TListControl::getDataTextField()
> TListControl::getDataTextFormatString()
> TListControl::getDataValueField()
> TListControl::getHasItems()
> TListControl::getIsMultiSelect()
> TListControl::getItemCount()
> TListControl::getItems()
> TListControl::getPostBackOptions()
> TListControl::getSelectedIndex()
> TListControl::getSelectedIndices()
> TListControl::getSelectedItem()
> TListControl::getSelectedValue()
> TListControl::getTagName()
> TListControl::getText()
> TListControl::getValidationGroup()
> TListControl::loadState()
> TListControl::onSelectedIndexChanged()
> TListControl::onTextChanged()
> TListControl::performDataBinding()
> TListControl::renderContents()
> TListControl::saveState()
> TListControl::setAppendDataBoundItems()
> TListControl::setAutoPostBack()
> TListControl::setCausesValidation()
> TListControl::setDataTextField()
> TListControl::setDataTextFormatString()
> TListControl::setDataValueField()
> TListControl::setSelectedIndex()
> TListControl::setSelectedIndices()
> TListControl::setSelectedValue()
> TListControl::setText()
> TListControl::setValidationGroup()

Inherited From TDataBoundControl

> TDataBoundControl::dataBind()
> TDataBoundControl::dataSourceViewChanged()
> TDataBoundControl::determineDataSource()
> TDataBoundControl::ensureDataBound()
> TDataBoundControl::getData()
> TDataBoundControl::getDataMember()
> TDataBoundControl::getDataSource()
> TDataBoundControl::getDataSourceID()
> TDataBoundControl::getDataSourceView()
> TDataBoundControl::getInitialized()
> TDataBoundControl::getIsDataBound()
> TDataBoundControl::getRequiresDataBinding()
> TDataBoundControl::getSelectParameters()
> TDataBoundControl::getUsingDataSourceID()
> TDataBoundControl::onDataBound()
> TDataBoundControl::onDataSourceChanged()
> TDataBoundControl::onInit()
> TDataBoundControl::onPagePreLoad()
> TDataBoundControl::onPreRender()
> TDataBoundControl::performDataBinding()
> TDataBoundControl::setDataMember()
> TDataBoundControl::setDataSource()
> TDataBoundControl::setDataSourceID()
> TDataBoundControl::setInitialized()
> TDataBoundControl::setIsDataBound()
> TDataBoundControl::setRequiresDataBinding()
> TDataBoundControl::validateDataSource()

Inherited From TWebControl

> TWebControl::addAttributesToRender()
> TWebControl::copyBaseAttributes()
> TWebControl::createStyle()
> TWebControl::getAccessKey()
> TWebControl::getBackColor()
> TWebControl::getBorderColor()
> TWebControl::getBorderStyle()
> TWebControl::getBorderWidth()
> TWebControl::getCssClass()
> 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::setForeColor()
> TWebControl::setHeight()
> TWebControl::setStyle()
> TWebControl::setTabIndex()
> TWebControl::setToolTip()
> TWebControl::setWidth()

Inherited From TControl

> TControl::__construct()
> TControl::addedControl()
> TControl::addParsedObject()
> TControl::applyStyleSheetSkin()
> TControl::autoBindProperty()
> TControl::autoDataBindProperties()
> TControl::bindProperty()
> TControl::broadcastEvent()
> TControl::broadcastEventInternal()
> TControl::clearChildState()
> TControl::clearControlState()
> TControl::clearNamingContainer()
> TControl::clearViewState()
> TControl::createChildControls()
> TControl::createControlCollection()
> TControl::createdOnTemplate()
> 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::getEnabled()
> TControl::getEnableTheming()
> TControl::getEnableViewState()
> TControl::getHasAdapter()
> TControl::getHasAttributes()
> TControl::getHasControls()
> 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::onBubbleEvent()
> 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::setEnabled()
> TControl::setEnableTheming()
> TControl::setEnableViewState()
> TControl::setID()
> TControl::setPage()
> TControl::setSkinID()
> TControl::setTemplateControl()
> TControl::setViewState()
> TControl::setVisible()
> 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::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()

Class Constants

#### Inherited Constants

Inherited from TControl

Documentation generated on Mon, 01 May 2006 23:02:54 -0400 by phpDocumentor 1.3.0RC4