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

TLinkButton creates a hyperlink style button on the page. TLinkButton has the same appearance as a hyperlink. However, it is mainly used to submit data to a page. Like {@link TButton}, you can create either a submit button or a command button. A command button has a command name (specified by the {@link setCommandName CommandName} property) and and a command parameter (specified by {@link setCommandParameter CommandParameter} property) associated with the button. This allows you to create multiple TLinkButton components on a Web page and programmatically determine which one is clicked with what parameter. You can provide an event handler for {@link onCommand OnCommand} event to programmatically control the actions performed when the command button is clicked. In the event handler, you can determine the {@link setCommandName CommandName} property value and the {@link setCommandParameter CommandParameter} property value through the {@link TCommandParameter::getName Name} and {@link TCommandParameter::getParameter Parameter} properties of the event parameter which is of type {@link \Prado\Web\UI\TCommandEventParameter}. A submit button does not have a command name associated with the button and clicking on it simply posts the Web page back to the server. By default, a TLinkButton component is a submit button. You can provide an event handler for the {@link onClick OnClick} event to programmatically control the actions performed when the submit button is clicked. Clicking on button can trigger form validation, if {@link setCausesValidation CausesValidation} is true. And the validation may be restricted within a certain group of validator controls by setting {@link setValidationGroup ValidationGroup} property. If validation is successful, the data will be post back to the same page. TLinkButton will display the {@link setText Text} property value as the hyperlink text. If {@link setText Text} is empty, the body content of TLinkButton will be displayed. Therefore, you can use TLinkButton as an image button by enclosing an <img> tag as the body of TLinkButton.
부터: 3.0
저자: Qiang Xue ([email protected])
상속: extends TWebControl, implements Prado\Web\UI\IPostBackEventHandler, implements Prado\Web\UI\IButtonControl, implements Prado\IDataRenderer
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
getCausesValidation ( ) : boolean
getCommandName ( ) : string
getCommandParameter ( ) : string
getData ( ) : string Returns the caption of the button.
getEnableClientScript ( ) : boolean
getIsDefaultButton ( ) : boolean
getText ( ) : string
getValidationGroup ( ) : string
onClick ( $param ) This method is invoked when the button is clicked.
onCommand ( $param ) This method is invoked when the button is clicked.
raisePostBackEvent ( $param ) Raises the postback event.
renderContents ( $writer ) Renders the body content enclosed between the control tag.
setCausesValidation ( $value ) Sets the value indicating whether postback event trigger by this button will cause input validation.
setCommandName ( $value )
setCommandParameter ( $value )
setData ( $value ) Sets the caption of the button.
setEnableClientScript ( $value )
setIsDefaultButton ( $value )
setText ( $value )
setValidationGroup ( $value )

보호된 메소드들

메소드 설명
addAttributesToRender ( $writer ) Adds attribute name-value pairs to renderer.
getClientClassName ( ) : string Gets the name of the javascript class responsible for performing postback for this control.
getPostBackOptions ( ) : array Returns postback specifications for the button.
getTagName ( ) : string
renderClientControlScript ( $writer ) Renders the client-script code.
renderLinkButtonHref ( $writer ) Renders the Href for link button.

메소드 상세

addAttributesToRender() 보호된 메소드

This overrides the parent implementation with additional button specific attributes.
protected addAttributesToRender ( $writer )

getCausesValidation() 공개 메소드

public getCausesValidation ( ) : boolean
리턴 boolean whether postback event trigger by this button will cause input validation

getClientClassName() 보호된 메소드

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

getCommandName() 공개 메소드

public getCommandName ( ) : string
리턴 string the command name associated with the {@link onCommand OnCommand} event.

getCommandParameter() 공개 메소드

public getCommandParameter ( ) : string
리턴 string the parameter associated with the {@link onCommand OnCommand} event

getData() 공개 메소드

This method is required by {@link \Prado\IDataRenderer}. It is the same as {@link getText()}.
또한 보기: getText
부터: 3.1.0
public getData ( ) : string
리턴 string caption of the button.

getEnableClientScript() 공개 메소드

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

getIsDefaultButton() 공개 메소드

public getIsDefaultButton ( ) : boolean
리턴 boolean true if this button is registered as a default button for a panel.

getPostBackOptions() 보호된 메소드

This method is used by framework and control developers.
protected getPostBackOptions ( ) : array
리턴 array parameters about how the button defines its postback behavior.

getTagName() 보호된 메소드

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

getText() 공개 메소드

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

getValidationGroup() 공개 메소드

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

onClick() 공개 메소드

The method raises 'OnClick' event to fire up the event handlers. If you override this method, be sure to call the parent implementation so that the event handler can be invoked.
public onClick ( $param )

onCommand() 공개 메소드

The method raises 'OnCommand' event to fire up the event handlers. If you override this method, be sure to call the parent implementation so that the event handlers can be invoked.
public onCommand ( $param )

raisePostBackEvent() 공개 메소드

This method is required by {@link IPostBackEventHandler} interface. If {@link getCausesValidation CausesValidation} is true, it will invoke the page's {@link TPage::validate validate} method first. It will raise {@link onClick OnClick} and {@link onCommand OnCommand} events. This method is mainly used by framework and control developers.
public raisePostBackEvent ( $param )

renderClientControlScript() 보호된 메소드

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

renderContents() 공개 메소드

If {@link getText Text} is not empty, it will be rendered. Otherwise, the body content enclosed in the control tag will be rendered.
public renderContents ( $writer )

renderLinkButtonHref() 보호된 메소드

Renders the Href for link button.
protected renderLinkButtonHref ( $writer )

setCausesValidation() 공개 메소드

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

setCommandName() 공개 메소드

public setCommandName ( $value )

setCommandParameter() 공개 메소드

public setCommandParameter ( $value )

setData() 공개 메소드

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

setEnableClientScript() 공개 메소드

public setEnableClientScript ( $value )

setIsDefaultButton() 공개 메소드

public setIsDefaultButton ( $value )

setText() 공개 메소드

public setText ( $value )

setValidationGroup() 공개 메소드

public setValidationGroup ( $value )