PHP 클래스 Prado\Web\UI\WebControls\TRadioButton

TRadioButton displays a radio button on the page. You can specify the caption to display beside the radio buttonby setting the {@link setText Text} property. The caption can appear either on the right or left of the radio button, which is determined by the {@link setTextAlign TextAlign} property. To determine whether the TRadioButton component is checked, test the {@link getChecked Checked} property. The {@link onCheckedChanged OnCheckedChanged} event is raised when the {@link getChecked Checked} state of the TRadioButton component changes between posts to the server. You can provide an event handler for the {@link 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 {@link setGroupName GroupName} to group together a set of radio buttons. Once the {@link setGroupName GroupName} is set, you can use the {@link getRadioButtonsInGroup} method to get an array of TRadioButtons having the same group name. If {@link setAutoPostBack AutoPostBack} is set true, changing the radio button state will cause postback action. And if {@link setCausesValidation CausesValidation} is true, validation will also be processed, which can be further restricted within a {@link setValidationGroup ValidationGroup}. Note, {@link setText Text} is rendered as is. Make sure it does not contain unwanted characters that may bring security vulnerabilities.
부터: 3.0
저자: Qiang Xue ([email protected])
상속: extends TCheckBox
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( ) Constructor.
getEnableClientScript ( ) : boolean
getGroupName ( ) : string
getRadioButtonsInGroup ( ) : array Gets an array of radiobuttons whose group name is the same as this radiobutton's.
getUniqueGroupName ( ) : string
loadPostData ( $key, $values ) : boolean Loads user input data.
onInit ( $param ) Registers the radio button groupings. If overriding onInit method, ensure to call parent implemenation.
onUnLoad ( $param ) Unregisters the radio button groupings. If overriding onInit method, ensure to call parent implemenation.
setEnableClientScript ( $value )
setGroupName ( $value ) Sets the name of the group that the radio button belongs to.
setUniqueGroupName ( $value ) Sets the unique group name that the radio button belongs to.

보호된 메소드들

메소드 설명
getClientClassName ( ) : string Gets the name of the javascript class responsible for performing postback for this control.
getValueAttribute ( ) : string
renderClientControlScript ( $writer ) Renders the client-script code.
renderInputTag ( $writer, $clientID, $onclick ) Renders a radiobutton input element.

메소드 상세

__construct() 공개 메소드

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

getClientClassName() 보호된 메소드

This method overrides the parent implementation.
protected getClientClassName ( ) : string
리턴 string the javascript class name

getEnableClientScript() 공개 메소드

public getEnableClientScript ( ) : boolean
리턴 boolean whether to render javascript.

getGroupName() 공개 메소드

public getGroupName ( ) : string
리턴 string the name of the group that the radio button belongs to. Defaults to empty.

getRadioButtonsInGroup() 공개 메소드

Note, only those radiobuttons that are on the current page hierarchy may be returned in the result.
public getRadioButtonsInGroup ( ) : array
리턴 array list of TRadioButton with the same group

getUniqueGroupName() 공개 메소드

public getUniqueGroupName ( ) : string
리턴 string the name used to fetch radiobutton post data

getValueAttribute() 보호된 메소드

protected getValueAttribute ( ) : string
리턴 string the value attribute to be rendered

loadPostData() 공개 메소드

This method is primarly used by framework developers.
public loadPostData ( $key, $values ) : boolean
리턴 boolean whether the data of the control has been changed

onInit() 공개 메소드

Registers the radio button groupings. If overriding onInit method, ensure to call parent implemenation.
public onInit ( $param )

onUnLoad() 공개 메소드

Unregisters the radio button groupings. If overriding onInit method, ensure to call parent implemenation.
public onUnLoad ( $param )

renderClientControlScript() 보호된 메소드

Renders the client-script code.
protected renderClientControlScript ( $writer )

renderInputTag() 보호된 메소드

Renders a radiobutton input element.
protected renderInputTag ( $writer, $clientID, $onclick )

setEnableClientScript() 공개 메소드

public setEnableClientScript ( $value )

setGroupName() 공개 메소드

The group is unique among the control's naming container.
또한 보기: setUniqueGroupName
public setGroupName ( $value )

setUniqueGroupName() 공개 메소드

A unique group is a radiobutton group unique among the whole page hierarchy, while the {@link setGroupName GroupName} specifies a group that is unique among the control's naming container only. For example, each cell of a {@link TDataGrid} is a naming container. If you specify {@link 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 {@link setGroupName GroupName}. On the contratry, if {@link setUniqueGroupName UniqueGroupName} is used instead, it will group all appropriate radio buttons on the whole page hierarchy. Note, when both {@link setUniqueGroupName UniqueGroupName} and {@link setGroupName GroupName}, the former takes precedence.
또한 보기: setGroupName
public setUniqueGroupName ( $value )