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

TCheckBox displays a check box on the page. You can specify the caption to display beside the check box by setting the {@link setText Text} property. The caption can appear either on the right or left of the check box, which is determined by the {@link setTextAlign TextAlign} property. To determine whether the TCheckBox component is checked, test the {@link getChecked Checked} property. The {@link onCheckedChanged OnCheckedChanged} event is raised when the {@link getChecked Checked} state of the TCheckBox 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 TCheckBox component changes between posts to the server. If {@link setAutoPostBack AutoPostBack} is set true, changing the check box 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 TWebControl, implements Prado\Web\UI\IPostBackDataHandler, implements Prado\Web\UI\IValidatable, implements Prado\IDataRenderer, implements Prado\Web\UI\ISurroundable
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
getAutoPostBack ( ) : boolean
getCausesValidation ( ) : boolean
getChecked ( ) : boolean
getData ( ) : boolean Returns the value indicating whether the checkbox is checked.
getDataChanged ( ) : boolean Returns a value indicating whether postback has caused the control data change.
getEnableClientScript ( ) : boolean
getInputAttributes ( ) : TMap
getIsValid ( ) : boolean Returns true if this control validated successfully.
getLabelAttributes ( ) : TMap
getSurroundingTag ( ) : string
getSurroundingTagID ( ) : string
getText ( ) : string
getTextAlign ( ) : TTextAlign
getValidationGroup ( ) : string
getValidationPropertyValue ( ) : mixed Returns the value of the property that needs validation.
getValue ( ) : string
loadPostData ( $key, $values ) : boolean Loads user input data.
onCheckedChanged ( $param ) Raises OnCheckedChanged event when {@link getChecked Checked} changes value during postback.
onPreRender ( $param ) Registers the checkbox to receive postback data during postback.
raisePostDataChangedEvent ( ) Raises postdata changed event.
render ( $writer ) Renders the checkbox control.
setAutoPostBack ( $value ) Sets a value indicating whether clicking on the checkbox will post the page.
setCausesValidation ( $value ) Sets the value indicating whether postback event trigger by this checkbox will cause input validation.
setChecked ( $value ) Sets a value indicating whether the checkbox is to be checked or not.
setData ( $value ) Sets the value indicating whether the checkbox is to be checked or not.
setEnableClientScript ( $value )
setIsValid ( $value )
setText ( $value ) Sets the text caption of the checkbox.
setTextAlign ( $value )
setValidationGroup ( $value )
setValue ( $value )

보호된 메소드들

메소드 설명
getClientClassName ( ) : string Gets the name of the javascript class responsible for performing postback for this control.
getPostBackOptions ( ) : array Gets the post back options for this checkbox.
getSpanNeeded ( ) : boolean Check if we need a span tag to surround this control. The span tag will be created if the Text property is set for this control.
getTagName ( ) : string
getValueAttribute ( ) : string
renderClientControlScript ( $writer ) Renders the client-script code.
renderInputTag ( $writer, $clientID, $onclick ) Renders a checkbox input element.
renderLabel ( $writer, $clientID, $text ) Renders a label beside the checkbox.

메소드 상세

getAutoPostBack() 공개 메소드

public getAutoPostBack ( ) : boolean
리턴 boolean whether clicking on the checkbox will post the page.

getCausesValidation() 공개 메소드

public getCausesValidation ( ) : boolean
리턴 boolean whether postback event triggered by this checkbox will cause input validation, default is true.

getChecked() 공개 메소드

public getChecked ( ) : boolean
리턴 boolean whether the checkbox is checked

getClientClassName() 보호된 메소드

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

getData() 공개 메소드

This method is required by {@link \Prado\IDataRenderer}. It is the same as {@link getChecked()}.
또한 보기: getChecked
부터: 3.1.0
public getData ( ) : boolean
리턴 boolean whether the checkbox is checked.

getDataChanged() 공개 메소드

This method is required by the \Prado\Web\UI\IPostBackDataHandler interface.
public getDataChanged ( ) : boolean
리턴 boolean whether postback has caused the control data change. False if the page is not in postback mode.

getEnableClientScript() 공개 메소드

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

getInputAttributes() 공개 메소드

public getInputAttributes ( ) : TMap
리턴 TMap list of attributes to be rendered for the checkbox

getIsValid() 공개 메소드

Defaults to true.
public getIsValid ( ) : boolean
리턴 boolean wether this control validated successfully.

getLabelAttributes() 공개 메소드

public getLabelAttributes ( ) : TMap
리턴 TMap list of attributes to be rendered for label beside the checkbox

getPostBackOptions() 보호된 메소드

Gets the post back options for this checkbox.
protected getPostBackOptions ( ) : array
리턴 array

getSpanNeeded() 보호된 메소드

Check if we need a span tag to surround this control. The span tag will be created if the Text property is set for this control.
protected getSpanNeeded ( ) : boolean
리턴 boolean wether this control needs a surrounding span tag

getSurroundingTag() 공개 메소드

public getSurroundingTag ( ) : string
리턴 string the tag used to wrap the control in.

getSurroundingTagID() 공개 메소드

public getSurroundingTagID ( ) : string
리턴 string the id of the surrounding tag or this clientID if no such tag needed.

getTagName() 보호된 메소드

protected getTagName ( ) : string
리턴 string tag name of the button

getText() 공개 메소드

public getText ( ) : string
리턴 string the text caption of the checkbox

getTextAlign() 공개 메소드

public getTextAlign ( ) : TTextAlign
리턴 TTextAlign the alignment (Left or Right) of the text caption, defaults to TTextAlign::Right.

getValidationGroup() 공개 메소드

public getValidationGroup ( ) : string
리턴 string the group of validators which the checkbox causes validation upon postback

getValidationPropertyValue() 공개 메소드

Returns the value of the property that needs validation.
public getValidationPropertyValue ( ) : mixed
리턴 mixed the property value to be validated

getValue() 공개 메소드

public getValue ( ) : string
리턴 string the value of the checkbox. Defaults to empty.

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

onCheckedChanged() 공개 메소드

If you override this method, be sure to call the parent implementation so that the event delegates can be invoked.
public onCheckedChanged ( $param )

onPreRender() 공개 메소드

This is necessary because a checkbox if unchecked, when postback, does not have direct mapping between post data and the checkbox name. This method overrides the parent implementation and is invoked before render.
public onPreRender ( $param )

raisePostDataChangedEvent() 공개 메소드

This method raises {@link onCheckedChanged OnCheckedChanged} event. This method is primarly used by framework developers.

render() 공개 메소드

This method overrides the parent implementation by rendering a checkbox input element and a span element if needed.
public render ( $writer )

renderClientControlScript() 보호된 메소드

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

renderInputTag() 보호된 메소드

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

renderLabel() 보호된 메소드

Renders a label beside the checkbox.
protected renderLabel ( $writer, $clientID, $text )

setAutoPostBack() 공개 메소드

Sets a value indicating whether clicking on the checkbox will post the page.
public setAutoPostBack ( $value )

setCausesValidation() 공개 메소드

Sets the value indicating whether postback event trigger by this checkbox will cause input validation.
public setCausesValidation ( $value )

setChecked() 공개 메소드

Sets a value indicating whether the checkbox is to be checked or not.
public setChecked ( $value )

setData() 공개 메소드

This method is required by {@link \Prado\IDataRenderer}. It is the same as {@link setChecked()}.
또한 보기: setChecked
부터: 3.1.0
public setData ( $value )

setEnableClientScript() 공개 메소드

public setEnableClientScript ( $value )

setIsValid() 공개 메소드

public setIsValid ( $value )

setText() 공개 메소드

Sets the text caption of the checkbox.
public setText ( $value )

setTextAlign() 공개 메소드

public setTextAlign ( $value )

setValidationGroup() 공개 메소드

public setValidationGroup ( $value )

setValue() 공개 메소드

public setValue ( $value )