## 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: $Id: TCheckBoxList.php 2433 2008-04-18 09:43:30Z tof $
- 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
--- | ---
TActiveCheckBoxList | TActiveCheckBoxList class.
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 ()
string getClientClassName ()
boolean getDataChanged ()
boolean getHasFooter ()
boolean getHasHeader ()
boolean getHasSeparators ()
boolean getIsMultiSelect ()
array getPostBackOptions ()
integer getRepeatColumns ()
string getRepeatDirection ()
TRepeatInfo getRepeatInfo ()
string getRepeatLayout ()
boolean getSpanNeeded ()
TTextAlign 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 (TTextAlign $value)
Methods
Constructor __construct (line 61)

Constructor.

Remember to call parent implementation if you override this method

- access: public

TCheckBoxList __construct ()

Redefinition of:

TControl::__construct()
  Constructor.

Redefined in descendants as:

- TActiveCheckBoxList::__construct() : Creates a new callback control, sets the adapter to TActiveListControlAdapter. If you override this class, be sure to set the adapter appropriately by, for example, by calling this constructor.
- TActiveRadioButtonList::__construct() : Creates a new callback control, sets the adapter to TActiveListControlAdapter. If you override this class, be sure to set the adapter appropriately by, for example, by calling this constructor.
- TActiveRatingList::__construct() : Sets the default repeat direction to horizontal.
- TRatingList::__construct()

createRepeatedControl (line 74)

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

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

TControl createRepeatedControl ()

Redefined in descendants as:

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

createStyle (line 104)

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

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 ()
getClientClassName (line 436)

Gets the name of the javascript class responsible for performing postback for this control.

This method overrides the parent implementation.

- return: the javascript class name
- access: protected

string getClientClassName ()

Redefinition of:

TListControl::getClientClassName()
  Gets the name of the javascript class responsible for performing postback for this control.

Redefined in descendants as:

- TRadioButtonList::getClientClassName() : Gets the name of the javascript class responsible for performing postback for this control.
- TActiveRatingList::getClientClassName() : Gets the name of the javascript class responsible for performing postback for this control.
- TRatingList::getClientClassName() : Gets the name of the javascript class responsible for performing postback for this control.

getDataChanged (line 416)

Returns a value indicating whether postback has caused the control data change.

This method is required by the IPostBackDataHandler interface.

- return: whether postback has caused the control data change. False if the page is not in postback mode.
- access: public

boolean getDataChanged ()
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 94)

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

getPostBackOptions (line 445)

Gets the post back options for this checkbox.

- access: protected

array getPostBackOptions ()

Redefinition of:

TListControl::getPostBackOptions()

Redefined in descendants as:

- TActiveRatingList::getPostBackOptions()

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 ()
getSpanNeeded (line 367)

Wether the list should be rendered inside a span or not

- return: true if we need a span
- access: protected

boolean getSpanNeeded ()
getTextAlign (line 112)

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

TTextAlign getTextAlign ()
getValidationPropertyValue (line 426)

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

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

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:

- TActiveRatingList::onPreRender() : Publish the the rating style css file and rating image files.
- TRatingList::onPreRender()

raisePostDataChangedEvent (line 335)

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

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.

Redefined in descendants as:

- TActiveRatingList::render() : Add rating style class name to the class attribute when setReadOnly property is true and when the setCssClass property is empty.

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:

- TActiveRatingList::renderItem() : Renders the rating images if setReadOnly is true otherwise render the radio buttons.
- 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)

Redefined in descendants as:

- TActiveRatingList::setRepeatLayout() : The repeat layout must be Table.

setTextAlign (line 120)

- access: public

void setTextAlign (TTextAlign $value)

- TTextAlign $value: the text alignment of the checkboxes

#### Inherited Methods

Inherited From TListControl

> TListControl::addAttributesToRender()
> TListControl::addParsedObject()
> TListControl::clearSelection()
> TListControl::createListItemCollection()
> TListControl::formatDataValue()
> TListControl::getAppendDataBoundItems()
> TListControl::getAutoPostBack()
> TListControl::getCausesValidation()
> TListControl::getClientClassName()
> TListControl::getData()
> TListControl::getDataGroupField()
> TListControl::getDataTextField()
> TListControl::getDataTextFormatString()
> TListControl::getDataValueField()
> TListControl::getEnableClientScript()
> TListControl::getHasItems()
> TListControl::getIsMultiSelect()
> TListControl::getItemCount()
> TListControl::getItems()
> TListControl::getPostBackOptions()
> TListControl::getPromptText()
> TListControl::getPromptValue()
> TListControl::getSelectedIndex()
> TListControl::getSelectedIndices()
> TListControl::getSelectedItem()
> TListControl::getSelectedValue()
> TListControl::getSelectedValues()
> TListControl::getTagName()
> TListControl::getText()
> TListControl::getValidationGroup()
> TListControl::loadState()
> TListControl::onSelectedIndexChanged()
> TListControl::onTextChanged()
> TListControl::performDataBinding()
> TListControl::renderClientControlScript()
> TListControl::renderContents()
> TListControl::renderPrompt()
> TListControl::saveState()
> TListControl::setAppendDataBoundItems()
> TListControl::setAutoPostBack()
> TListControl::setCausesValidation()
> TListControl::setData()
> TListControl::setDataGroupField()
> TListControl::setDataTextField()
> TListControl::setDataTextFormatString()
> TListControl::setDataValueField()
> TListControl::setEnableClientScript()
> TListControl::setPromptText()
> TListControl::setPromptValue()
> TListControl::setSelectedIndex()
> TListControl::setSelectedIndices()
> TListControl::setSelectedValue()
> TListControl::setSelectedValues()
> TListControl::setText()
> TListControl::setValidationGroup()

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

#### 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 Mon, 21 Apr 2008 11:33:08 -0400 by phpDocumentor 1.3.0RC4