PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

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
Extended by TApplicationComponent
Extended by TControl implements IRenderable, IBindable
Extended by TWebControl implements IStyleable
Extended by TCheckBox implements IPostBackDataHandler, IValidatable, IDataRenderer, ISurroundable
Extended by TRadioButton

Direct known subclasses

TActiveRadioButton
Package: System\Web\UI\WebControls
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at Web/UI/WebControls/TRadioButton.php
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

TControl::__construct()
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

$param
TEventParameter
event parameter to be passed to the event handlers

Overrides

TControl::onInit()
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

$param
TEventParameter
event parameter to be passed to the event handlers
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

TCheckBox::loadPostData()
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

TRadioButton::setUniqueGroupName()
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

TControl::addToPostDataLoader()
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

TRadioButton::setGroupName()
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

TCheckBox::getValueAttribute()
public boolean
# getEnableClientScript( )

Returns

boolean
whether to render javascript.

Overrides

TCheckBox::getEnableClientScript()
public
# setEnableClientScript( boolean $value )

Parameters

$value
boolean
whether to render javascript.

Overrides

TCheckBox::setEnableClientScript()
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

TCheckBox::renderInputTag()
protected
# renderClientControlScript( mixed $writer )

Renders the client-script code.

Renders the client-script code.

Overrides

TCheckBox::renderClientControlScript()
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

TCheckBox::getClientClassName()
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 TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
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
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Properties inherited from TWebControl
$_decorator
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO