Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml


Classes:
IDataSource
IItemDataRenderer
IRepeatInfoUser
TActiveFileUpload
TBaseDataList
TBaseValidator
TBoundColumn
TBulletedList
TBulletedListDisplayMode
TBulletedListEventParameter
TBulletStyle
TButton
TButtonColumn
TButtonColumnType
TButtonType
TCaptcha
TCaptchaValidator
TCheckBox
TCheckBoxColumn
TCheckBoxList
TCircleHotSpot
TClientScript
TClientScriptLoader
TClientSideValidationSummaryOptions
TColorPicker
TColorPickerClientSide
TColorPickerMode
TCompareValidator
TCompleteWizardStep
TConditional
TContent
TContentDirection
TContentPlaceHolder
TCustomValidator
TDataBoundControl
TDataGrid
TDataGridColumn
TDataGridColumnCollection
TDataGridCommandEventParameter
TDataGridItem
TDataGridItemCollection
TDataGridItemEventParameter
TDataGridItemRenderer
TDataGridPageChangedEventParameter
TDataGridPager
TDataGridPagerButtonType
TDataGridPagerEventParameter
TDataGridPagerMode
TDataGridPagerPosition
TDataGridPagerStyle
TDataGridSortCommandEventParameter
TDataList
TDataListCommandEventParameter
TDataListItem
TDataListItemCollection
TDataListItemEventParameter
TDataListItemRenderer
TDataRenderer
TDataSourceControl
TDataSourceSelectParameters
TDataSourceView
TDataTypeValidator
TDatePicker
TDatePickerClientScript
TDatePickerInputMode
TDatePickerMode
TDatePickerPositionMode
TDisplayStyle
TDraggable
TDropContainer
TDropDownList
TDropDownListColumn
TEditCommandColumn
TEmailAddressValidator
TExpression
TFileUpload
TFont
THiddenField
THorizontalAlign
THotSpot
THotSpotCollection
THotSpotMode
THtmlArea
THtmlElement
THyperLink
THyperLinkColumn
TImage
TImageButton
TImageClickEventParameter
TImageMap
TImageMapEventParameter
TInlineFrame
TInlineFrameAlign
TInlineFrameScrollBars
TItemDataRenderer
TJavascriptLogger
TKeyboard
TLabel
TLinkButton
TListBox
TListControl
TListControlValidator
TListItem
TListItemCollection
TListItemType
TListSelectionMode
TLiteral
TLiteralColumn
TMarkdown
TMetaTag
TMetaTagCollection
TMultiView
TOutputCache
TOutputCacheCalculateKeyEventParameter
TOutputCacheCheckDependencyEventParameter
TPager
TPagerButtonType
TPagerMode
TPagerPageChangedEventParameter
TPanel
TPanelStyle
TPlaceHolder
TPolygonHotSpot
TRadioButton
TRadioButtonList
TRangeValidationDataType
TRangeValidator
TRatingList
TReadOnlyDataSource
TReadOnlyDataSourceView
TRectangleHotSpot
TRegularExpressionValidator
TRepeatDirection
TRepeater
TRepeaterCommandEventParameter
TRepeaterItem
TRepeaterItemCollection
TRepeaterItemEventParameter
TRepeaterItemRenderer
TRepeatInfo
TRepeatLayout
TRequiredFieldValidator
TSafeHtml
TScrollBars
TServerValidateEventParameter
TSlider
TSliderClientScript
TSliderDirection
TStatements
TStyle
TStyleSheet
TTable
TTableCaptionAlign
TTableCell
TTableCellCollection
TTableFooterRow
TTableGridLines
TTableHeaderCell
TTableHeaderRow
TTableHeaderScope
TTableItemStyle
TTableRow
TTableRowCollection
TTableRowSection
TTableStyle
TTabPanel
TTabView
TTabViewCollection
TTemplateColumn
TTemplatedWizardStep
TTextAlign
TTextBox
TTextBoxAutoCompleteType
TTextBoxMode
TTextHighlighter
TTextHighlighterLineNumberStyle
TValidationCompareOperator
TValidationDataType
TValidationSummary
TValidationSummaryDisplayMode
TValidationSummaryDisplayStyle
TValidatorClientSide
TValidatorDisplayStyle
TVerticalAlign
TView
TViewCollection
TWebControl
TWebControlAdapter
TWizard
TWizardFinishNavigationTemplate
TWizardNavigationButtonStyle
TWizardNavigationButtonType
TWizardNavigationContainer
TWizardNavigationEventParameter
TWizardNavigationTemplate
TWizardSideBarListItemTemplate
TWizardSideBarTemplate
TWizardStartNavigationTemplate
TWizardStep
TWizardStepCollection
TWizardStepNavigationTemplate
TWizardStepType
TXmlTransform
Keyword

Class TRadioButton

Direct Known Sub-classes:

TRadioButton class

TRadioButton displays a radio button on the page. You can specify the caption to display beside the radio buttonby setting the Text property. The caption can appear either on the right or left of the radio button, which is determined by the TextAlign property.

To determine whether the TRadioButton component is checked, test the Checked property. The OnCheckedChanged event is raised when the Checked state of the TRadioButton component changes between posts to the server. You can provide an event handler for the OnCheckedChanged event to to programmatically control the actions performed when the state of the TRadioButton component changes between posts to the server.

TRadioButton uses GroupName to group together a set of radio buttons. Once the GroupName is set, you can use the getRadioButtonsInGroup method to get an array of TRadioButtons having the same group name.

If AutoPostBack is set true, changing the radio button state will cause postback action. And if CausesValidation is true, validation will also be processed, which can be further restricted within a ValidationGroup.

Note, Text is rendered as is. Make sure it does not contain unwanted characters that may bring security vulnerabilities.

Since: 3.0
Author: Qiang Xue <qiang.xue@gmail.com>
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  void
Add the group name as post data loader if group name is set.
protected  string
Gets the name of the javascript class responsible for performing postback for this control.
boolean
string
array
Gets an array of radiobuttons whose group name is the same as this radiobutton's.
string
protected  string
boolean
loadPostData ( string $key, array $values)
Loads user input data.
void
Registers the radio button groupings. If overriding onInit method, ensure to call parent implemenation.
void
Unregisters the radio button groupings. If overriding onInit method, ensure to call parent implemenation.
protected  void
renderClientControlScript ( mixed $writer)
Renders the client-script code.
protected  void
renderInputTag ( THtmlWriter $writer, string $clientID, string $onclick)
Renders a radiobutton input element.
void
setEnableClientScript ( boolean $value)
void
setGroupName ( string $value)
Sets the name of the group that the radio button belongs to.
void
setUniqueGroupName ( string $value)
Sets the unique group name that the radio button belongs to.
Methods Inherited From TCheckBox
TCheckBox::getAutoPostBack(), TCheckBox::getCausesValidation(), TCheckBox::getChecked(), TCheckBox::getClientClassName(), TCheckBox::getData(), TCheckBox::getDataChanged(), TCheckBox::getEnableClientScript(), TCheckBox::getInputAttributes(), TCheckBox::getIsValid(), TCheckBox::getLabelAttributes(), TCheckBox::getPostBackOptions(), TCheckBox::getSpanNeeded(), TCheckBox::getSurroundingTagID(), TCheckBox::getTagName(), TCheckBox::getText(), TCheckBox::getTextAlign(), TCheckBox::getValidationGroup(), TCheckBox::getValidationPropertyValue(), TCheckBox::getValue(), TCheckBox::getValueAttribute(), TCheckBox::loadPostData(), TCheckBox::onCheckedChanged(), TCheckBox::onPreRender(), TCheckBox::raisePostDataChangedEvent(), TCheckBox::render(), TCheckBox::renderClientControlScript(), TCheckBox::renderInputTag(), TCheckBox::renderLabel(), TCheckBox::setAutoPostBack(), TCheckBox::setCausesValidation(), TCheckBox::setChecked(), TCheckBox::setData(), TCheckBox::setEnableClientScript(), TCheckBox::setIsValid(), TCheckBox::setText(), TCheckBox::setTextAlign(), TCheckBox::setValidationGroup(), TCheckBox::setValue()
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 TApplicationComponent
TApplicationComponent::getApplication(), TApplicationComponent::getRequest(), TApplicationComponent::getResponse(), TApplicationComponent::getService(), TApplicationComponent::getSession(), TApplicationComponent::getUser(), TApplicationComponent::publishAsset(), TApplicationComponent::publishFilePath()
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()

Constant Summary

Constructor Details

__construct

public __construct

Constructor.

Registers the radiobutton in a global radiobutton collection. If overridden, the parent implementation must be invoked first.


Method Details

addToPostDataLoader

protected void addToPostDataLoader ()

Add the group name as post data loader if group name is set.

Output
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

getEnableClientScript

public boolean getEnableClientScript ()

Output
boolean whether to render javascript.
Exception

getGroupName

public string getGroupName ()

Output
string the name of the group that the radio button belongs to. Defaults to empty.
Exception

getRadioButtonsInGroup

public array getRadioButtonsInGroup ()

Gets an array of radiobuttons whose group name is the same as this radiobutton's.

Note, only those radiobuttons that are on the current page hierarchy may be returned in the result.

Output
array list of TRadioButton with the same group
Exception

getUniqueGroupName

public string getUniqueGroupName ()

Output
string the name used to fetch radiobutton post data
Exception

getValueAttribute

protected string getValueAttribute ()

Output
string the value attribute to be rendered
Exception

loadPostData

public boolean loadPostData (string $key , array $values )

Loads user input data.

This method is primarly used by framework developers.

Input
string$keythe key that can be used to retrieve data from the input data collection
array$valuesthe input data collection
Output
boolean whether the data of the control has been changed
Exception

onInit

public void onInit (TEventParameter $param )

Registers the radio button groupings. If overriding onInit method, ensure to call parent implemenation.

Input
TEventParameter$paramevent parameter to be passed to the event handlers
Output
Exception

onUnLoad

public void onUnLoad (TEventParameter $param )

Unregisters the radio button groupings. If overriding onInit method, ensure to call parent implemenation.

Input
TEventParameter$paramevent parameter to be passed to the event handlers
Output
Exception

renderClientControlScript

protected void renderClientControlScript (mixed $writer )

Renders the client-script code.

Input
mixed$writer
Output
Exception

renderInputTag

protected void renderInputTag (THtmlWriter $writer , string $clientID , string $onclick )

Renders a radiobutton input element.

Input
THtmlWriter$writerthe writer for the rendering purpose
string$clientIDcheckbox id
string$onclickonclick js
Output
Exception

setEnableClientScript

public void setEnableClientScript (boolean $value )

Input
boolean$valuewhether to render javascript.
Output
Exception

setGroupName

public void setGroupName (string $value )

Sets the name of the group that the radio button belongs to.

The group is unique among the control's naming container.

Input
string$valuethe group name
Output
Exception

setUniqueGroupName

public void setUniqueGroupName (string $value )

Sets the unique group name that the radio button belongs to.

A unique group is a radiobutton group unique among the whole page hierarchy, while the GroupName specifies a group that is unique among the control's naming container only. For example, each cell of a TDataGrid is a naming container. If you specify GroupName for a radiobutton in a cell, it groups together radiobutton within a cell, but not the other, even though they have the same GroupName. On the contratry, if UniqueGroupName is used instead, it will group all appropriate radio buttons on the whole page hierarchy. Note, when both UniqueGroupName and GroupName, the former takes precedence.

Input
string$valuethe group name
Output
Exception