|
Class TRadioButton
TRadioButton class
TRadioButton displays a radio button on the page. You can specify the caption
to display beside the radio buttonby setting the setText Text property.
The caption can appear either on the right or left of the radio button, which is
determined by the setTextAlign TextAlign property.
To determine whether the TRadioButton component is checked, test the getChecked Checked property. The onCheckedChanged OnCheckedChanged
event is raised when the getChecked Checked state of the TRadioButton
component changes between posts to the server. You can provide an event handler
for the onCheckedChanged OnCheckedChanged event to to programmatically
control the actions performed when the state of the TRadioButton component
changes between posts to the server.
TRadioButton uses setGroupName GroupName to group together a set of
radio buttons. Once the setGroupName GroupName is set, you can use the
TRadioButton::getRadioButtonsInGroup() method to get an array of TRadioButtons having
the same group name.
If setAutoPostBack AutoPostBack is set true, changing the radio
button state will cause postback action. And if setCausesValidation
CausesValidation is true, validation will also be processed, which can be
further restricted within a setValidationGroup ValidationGroup.
Note, setText Text is rendered as is. Make sure it does not contain
unwanted characters that may bring security vulnerabilities.
-
TComponent
-
TApplicationComponent
-
TControl
implements
IRenderable,
IBindable
-
TWebControl
implements
IStyleable
-
TCheckBox
implements
IPostBackDataHandler,
IValidatable,
IDataRenderer,
ISurroundable
-
TRadioButton
Methods summary
public
|
#
__construct( )
Constructor. Registers the radiobutton in a global radiobutton collection. If
overridden, the parent implementation must be invoked first.
Constructor. Registers the radiobutton in a global radiobutton collection. If
overridden, the parent implementation must be invoked first.
Overrides
|
public
|
#
onInit( TEventParameter $param )
Registers the radio button groupings. If overriding onInit method, ensure to
call parent implemenation.
Registers the radio button groupings. If overriding onInit method, ensure to
call parent implemenation.
Parameters
Overrides
|
public
|
#
onUnLoad( TEventParameter $param )
Unregisters the radio button groupings. If overriding onInit method, ensure
to call parent implemenation.
Unregisters the radio button groupings. If overriding onInit method, ensure
to call parent implemenation.
Parameters
|
public
boolean
|
#
loadPostData( string $key, array $values )
Loads user input data. This method is primarly used by framework
developers.
Loads user input data. This method is primarly used by framework
developers.
Parameters
- $key
string the key that can be used to retrieve data from the input data collection
- $values
array the input data collection
Returns
boolean whether the data of the control has been changed
Overrides
|
public
string
|
#
getGroupName( )
Returns
string the name of the group that the radio button belongs to. Defaults to empty.
|
public
|
#
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.
Sets the name of the group that the radio button belongs to. The group is
unique among the control's naming container.
Parameters
- $value
string the group name
See
|
protected
|
#
addToPostDataLoader( )
Add the group name as post data loader if group name is set.
Add the group name as post data loader if group name is set.
Overrides
|
public
string
|
#
getUniqueGroupName( )
Returns
string the name used to fetch radiobutton post data
|
public
|
#
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 setGroupName 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 setGroupName GroupName for a radiobutton in a
cell, it groups together radiobutton within a cell, but not the other, even
though they have the same setGroupName GroupName. On the contratry, if
setUniqueGroupName UniqueGroupName is used instead, it will group all
appropriate radio buttons on the whole page hierarchy. Note, when both setUniqueGroupName UniqueGroupName and setGroupName GroupName, the
former takes precedence.
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 setGroupName 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 setGroupName GroupName for a radiobutton in a
cell, it groups together radiobutton within a cell, but not the other, even
though they have the same setGroupName GroupName. On the contratry, if
setUniqueGroupName UniqueGroupName is used instead, it will group all
appropriate radio buttons on the whole page hierarchy. Note, when both setUniqueGroupName UniqueGroupName and setGroupName GroupName, the
former takes precedence.
Parameters
- $value
string the group name
See
|
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.
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.
Returns
array list of TRadioButton with the same group
|
protected
string
|
#
getValueAttribute( )
Returns
string the value attribute to be rendered
Overrides
|
public
boolean
|
#
getEnableClientScript( )
Returns
boolean whether to render javascript.
Overrides
|
public
|
#
setEnableClientScript( boolean $value )
Parameters
- $value
boolean whether to render javascript.
Overrides
|
protected
|
#
renderInputTag( THtmlWriter $writer, string $clientID, string $onclick )
Renders a radiobutton input element.
Renders a radiobutton input element.
Parameters
- $writer
THtmlWriter
the writer for the rendering purpose
- $clientID
string checkbox id
- $onclick
string onclick js
Overrides
|
protected
|
#
renderClientControlScript( mixed $writer )
Renders the client-script code.
Renders the client-script code.
Overrides
|
protected
string
|
#
getClientClassName( )
Gets the name of the javascript class responsible for performing postback for
this control. This method overrides the parent implementation.
Gets the name of the javascript class responsible for performing postback for
this control. This method overrides the parent implementation.
Returns
string the javascript class name
Overrides
|
Methods inherited from TCheckBox
getAutoPostBack(),
getCausesValidation(),
getChecked(),
getData(),
getDataChanged(),
getInputAttributes(),
getIsValid(),
getLabelAttributes(),
getPostBackOptions(),
getSpanNeeded(),
getSurroundingTagID(),
getTagName(),
getText(),
getTextAlign(),
getValidationGroup(),
getValidationPropertyValue(),
getValue(),
onCheckedChanged(),
onPreRender(),
raisePostDataChangedEvent(),
render(),
renderLabel(),
setAutoPostBack(),
setCausesValidation(),
setChecked(),
setData(),
setIsValid(),
setText(),
setTextAlign(),
setValidationGroup(),
setValue()
|
Methods inherited from TWebControl
addAttributesToRender(),
clearStyle(),
copyBaseAttributes(),
createStyle(),
getAccessKey(),
getBackColor(),
getBorderColor(),
getBorderStyle(),
getBorderWidth(),
getCssClass(),
getDecorator(),
getDisplay(),
getEnsureId(),
getFont(),
getForeColor(),
getHasStyle(),
getHeight(),
getStyle(),
getTabIndex(),
getToolTip(),
getWidth(),
renderBeginTag(),
renderContents(),
renderEndTag(),
setAccessKey(),
setBackColor(),
setBorderColor(),
setBorderStyle(),
setBorderWidth(),
setCssClass(),
setDisplay(),
setEnsureId(),
setForeColor(),
setHeight(),
setStyle(),
setTabIndex(),
setToolTip(),
setWidth()
|
Methods inherited from TControl
__get(),
addParsedObject(),
addedControl(),
applyStyleSheetSkin(),
autoBindProperty(),
autoDataBindProperties(),
bindProperty(),
broadcastEvent(),
bubbleEvent(),
clearChildState(),
clearControlState(),
clearNamingContainer(),
clearViewState(),
convertUniqueIdToClientId(),
createChildControls(),
createControlCollection(),
dataBind(),
dataBindChildren(),
dataBindProperties(),
ensureChildControls(),
findControl(),
findControlsByID(),
findControlsByType(),
focus(),
getAdapter(),
getAllowChildControls(),
getAttribute(),
getAttributes(),
getChildControlsCreated(),
getClientID(),
getControlStage(),
getControlState(),
getControls(),
getCustomData(),
getEnableTheming(),
getEnableViewState(),
getEnabled(),
getHasAdapter(),
getHasAttributes(),
getHasChildInitialized(),
getHasControls(),
getHasInitialized(),
getHasLoaded(),
getHasLoadedPostData(),
getHasPreRendered(),
getID(),
getIsSkinApplied(),
getNamingContainer(),
getPage(),
getParent(),
getRegisteredObject(),
getSkinID(),
getSourceTemplateControl(),
getTemplateControl(),
getUniqueID(),
getViewState(),
getVisible(),
hasAttribute(),
initRecursive(),
isDescendentOf(),
isObjectRegistered(),
loadRecursive(),
loadState(),
loadStateRecursive(),
onDataBinding(),
onLoad(),
onUnload(),
preRenderRecursive(),
raiseBubbleEvent(),
registerObject(),
removeAttribute(),
removedControl(),
renderChildren(),
renderControl(),
saveState(),
saveStateRecursive(),
setAdapter(),
setAttribute(),
setChildControlsCreated(),
setControlStage(),
setControlState(),
setCustomData(),
setEnableTheming(),
setEnableViewState(),
setEnabled(),
setID(),
setPage(),
setSkinID(),
setTemplateControl(),
setViewState(),
setVisible(),
trackViewState(),
traverseChildControls(),
unbindProperty(),
unloadRecursive(),
unregisterObject()
|
Methods inherited from TComponent
__call(),
__destruct(),
__isset(),
__set(),
__sleep(),
__unset(),
__wakeup(),
asa(),
attachBehavior(),
attachBehaviors(),
attachClassBehavior(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
clearBehaviors(),
createdOnTemplate(),
detachBehavior(),
detachBehaviors(),
detachClassBehavior(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
evaluateStatements(),
fxAttachClassBehavior(),
fxDetachClassBehavior(),
getAutoGlobalListen(),
getBehaviorsEnabled(),
getClassHierarchy(),
getEventHandlers(),
getListeningToGlobalEvents(),
getSubProperty(),
hasEvent(),
hasEventHandler(),
hasProperty(),
isa(),
listen(),
raiseEvent(),
setSubProperty(),
unlisten()
|
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
|
|