Class TCheckBoxList
Direct Known Sub-classes:
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.
Constants Inherited From TControl |
AUTOMATIC_ID_PREFIX,
CLIENT_ID_SEPARATOR,
CS_CHILD_INITIALIZED,
CS_CONSTRUCTED,
CS_INITIALIZED,
CS_LOADED,
CS_PRERENDERED,
CS_STATE_LOADED,
ID_FORMAT,
ID_SEPARATOR,
IS_CHILD_CREATED,
IS_CREATING_CHILD,
IS_DISABLE_THEMING,
IS_DISABLE_VIEWSTATE,
IS_ID_SET,
IS_SKIN_APPLIED,
IS_STYLESHEET_APPLIED,
RF_ADAPTER,
RF_AUTO_BINDINGS,
RF_CHILD_STATE,
RF_CONTROLS,
RF_CONTROLSTATE,
RF_DATA_BINDINGS,
RF_EVENTS,
RF_NAMED_CONTROLS,
RF_NAMED_CONTROLS_ID,
RF_NAMED_OBJECTS,
RF_SKIN_ID,
|
Constructor Summary |
public |
Constructor.
|
Method Summary |
protected
TControl
|
Creates a control used for repetition (used as a template).
|
protected
TStyle
|
Creates a style object for the control.
|
TControl
|
Finds a control by ID.
|
null
|
Returns a style used for rendering items.
|
integer
|
|
integer
|
|
protected
string
|
Gets the name of the javascript class responsible for performing postback for this control.
|
boolean
|
Returns a value indicating whether postback has caused the control data change.
|
boolean
|
Returns a value indicating whether this control contains footer item.
|
boolean
|
Returns a value indicating whether this control contains header item.
|
boolean
|
Returns a value indicating whether this control contains separator items.
|
protected
boolean
|
|
bool
|
Returns true if this control validated successfully.
|
protected
array
|
Gets the post back options for this checkbox.
|
integer
|
|
string
|
|
protected
TRepeatInfo
|
|
string
|
|
protected
boolean
|
Wether the list should be rendered inside a span or not
|
TTextAlign
|
|
mixed
|
Returns the value to be validated.
|
boolean
|
Loads user input data.
|
void
|
Registers for post data on postback.
|
void
|
Raises postdata changed event.
|
void
|
Renders the checkbox list control.
|
void
|
Renders an item in the list.
|
void
|
Sets the cellpadding for the table keeping the checkbox list.
|
void
|
Sets the cellspacing for the table keeping the checkbox list.
|
void
|
|
void
|
|
void
|
|
void
|
|
void
|
|
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()
|
Methods 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::setAllowCustomPaging(), TDataBoundControl::setAllowPaging(), TDataBoundControl::setCurrentPageIndex(), TDataBoundControl::setDataMember(), TDataBoundControl::setDataSource(), TDataBoundControl::setDataSourceID(), TDataBoundControl::setInitialized(), TDataBoundControl::setIsDataBound(), TDataBoundControl::setPageSize(), TDataBoundControl::setRequiresDataBinding(), TDataBoundControl::setVirtualItemCount(), TDataBoundControl::validateDataSource()
|
Methods 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()
|
Methods Inherited From TControl |
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()
|
Methods 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()
|
Constructor Details |
__construct
Constructor.
Remember to call parent implementation if you override this method
|
Method Details |
createRepeatedControl
protected TControl createRepeatedControl |
() |
Creates a control used for repetition (used as a template).
Output |
TControl
| the control to be repeated |
Exception |
|
createStyle
protected TStyle createStyle |
() |
Creates a style object for the control.
This method creates a TTableStyle to be used by checkbox list.
Output |
TStyle
| control style to be used |
Exception |
|
findControl
public TControl findControl |
(string $id ) |
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.)
Input |
string | $id | control ID |
Output |
TControl
| control being found |
Exception |
|
generateItemStyle
public null generateItemStyle |
(string $itemType , integer $index ) |
Returns a style used for rendering items.
This method is required by IRepeatInfoUser interface.
Input |
string | $itemType | item type (Header,Footer,Item,AlternatingItem,SelectedItem,EditItem,Separator,Pager) |
integer | $index | index of the item being rendered |
Output |
Exception |
|
getCellPadding
public integer getCellPadding |
() |
Output |
integer
| the cellpadding for the table keeping the checkbox list. Defaults to -1, meaning not set. |
Exception |
|
getCellSpacing
public integer getCellSpacing |
() |
Output |
integer
| the cellspacing for the table keeping the checkbox list. Defaults to -1, meaning not set. |
Exception |
|
getClientClassName
protected string getClientClassName |
() |
Gets the name of the javascript class responsible for performing postback for this control.
This method overrides the parent implementation.
Output |
string
| the javascript class name |
Exception |
|
getDataChanged
public boolean getDataChanged |
() |
Returns a value indicating whether postback has caused the control data change.
This method is required by the IPostBackDataHandler interface.
Output |
boolean
| whether postback has caused the control data change. False if the page is not in postback mode. |
Exception |
|
getHasFooter
public boolean getHasFooter |
() |
Returns a value indicating whether this control contains footer item.
This method is required by IRepeatInfoUser interface.
Output |
boolean
| always false. |
Exception |
|
getHasHeader
public boolean getHasHeader |
() |
Returns a value indicating whether this control contains header item.
This method is required by IRepeatInfoUser interface.
Output |
boolean
| always false. |
Exception |
|
getHasSeparators
public boolean getHasSeparators |
() |
Returns a value indicating whether this control contains separator items.
This method is required by IRepeatInfoUser interface.
Output |
boolean
| always false. |
Exception |
|
getIsMultiSelect
protected boolean getIsMultiSelect |
() |
Output |
boolean
| whether this control supports multiple selection. Always true for checkbox list. |
Exception |
|
getIsValid
public bool getIsValid |
() |
Returns true if this control validated successfully.
Defaults to true.
Output |
bool
| wether this control validated successfully. |
Exception |
|
getPostBackOptions
protected array getPostBackOptions |
() |
Gets the post back options for this checkbox.
|
getRepeatColumns
public integer getRepeatColumns |
() |
Output |
integer
| the number of columns that the list should be displayed with. Defaults to 0 meaning not set. |
Exception |
|
getRepeatDirection
public string getRepeatDirection |
() |
Output |
string
| the direction of traversing the list, defaults to 'Vertical' |
Exception |
|
getRepeatInfo
Output |
TRepeatInfo
| repeat information (primarily used by control developers) |
Exception |
|
getRepeatLayout
public string getRepeatLayout |
() |
Output |
string
| how the list should be displayed, using table or using line breaks. Defaults to 'Table'. |
Exception |
|
getSpanNeeded
protected boolean getSpanNeeded |
() |
Wether the list should be rendered inside a span or not
Output |
boolean
| true if we need a span |
Exception |
|
getTextAlign
Output |
TTextAlign
| the alignment of the text caption, defaults to TTextAlign::Right. |
Exception |
|
getValidationPropertyValue
public mixed getValidationPropertyValue |
() |
Returns the value to be validated.
This methid is required by IValidatable interface.
Output |
mixed
| the value of the property to be validated. |
Exception |
|
loadPostData
public boolean loadPostData |
(string $key , array $values ) |
Loads user input data.
This method is primarly used by framework developers.
Input |
string | $key | the key that can be used to retrieve data from the input data collection |
array | $values | the input data collection |
Output |
boolean
| whether the data of the control has been changed |
Exception |
|
onPreRender
public void onPreRender |
(mixed $param ) |
Registers for post data on postback.
This method overrides the parent implementation.
Input |
mixed | $param | event parameter |
Output |
Exception |
|
raisePostDataChangedEvent
public void raisePostDataChangedEvent |
() |
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.
|
render
Renders the checkbox list control.
This method overrides the parent implementation.
Input |
THtmlWriter | $writer | writer for rendering purpose. |
Output |
Exception |
|
renderItem
Renders an item in the list.
This method is required by IRepeatInfoUser interface.
Input |
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 |
Output |
Exception |
|
setCellPadding
public void setCellPadding |
(integer $value ) |
Sets the cellpadding for the table keeping the checkbox list.
Input |
integer | $value | the cellpadding for the table keeping the checkbox list. |
Output |
Exception |
|
setCellSpacing
public void setCellSpacing |
(integer $value ) |
Sets the cellspacing for the table keeping the checkbox list.
Input |
integer | $value | the cellspacing for the table keeping the checkbox list. |
Output |
Exception |
|
setIsValid
public void setIsValid |
(bool $value ) |
Input |
bool | $value | wether this control is valid. |
Output |
Exception |
|
setRepeatColumns
public void setRepeatColumns |
(integer $value ) |
Input |
integer | $value | the number of columns that the list should be displayed with. |
Output |
Exception |
|
setRepeatDirection
public void setRepeatDirection |
(string $value ) |
Input |
string | $value | the direction (Vertical, Horizontal) of traversing the list |
Output |
Exception |
|
setRepeatLayout
public void setRepeatLayout |
(string $value ) |
Input |
string | $value | how the list should be displayed, using table or using line breaks (Table, Flow) |
Output |
Exception |
|
setTextAlign
Input |
TTextAlign | $value | the text alignment of the checkboxes |
Output |
Exception |
|
|