PHP Class Prado\Web\UI\ActiveControls\TInPlaceTextBox

TInPlaceTextBox is a component rendered as a label and allows its contents to be edited by changing the label to a textbox when the label is clicked or when another control or html element with ID given by {@link setEditTriggerControlID EditTriggerControlID} is clicked. If the {@link OnLoadingText} event is handled, a callback request is made when the label is clicked, while the request is being made the textbox is disabled from editing. The {@link OnLoadingText} event allows you to update the content of the textbox before the client is allowed to edit the content. After the callback request returns successfully, the textbox is enabled and the contents is then allowed to be edited. Once the textbox loses focus, if {@link setAutoPostBack AutoPostBack} is true and the textbox content has changed, a callback request is made and the {@link OnTextChanged} event is raised like that of the TActiveTextBox. During the request, the textbox is disabled. After the callback request returns sucessfully, the textbox is enabled. If the {@link setAutoHideTextBox AutoHideTextBox} property is true, then the textbox will be hidden and the label is then shown. Since 3.1.2, you can set the {@link setReadOnly ReadOnly} property to make the control not editable. This property can be also changed on callback
Since: 3.1
Inheritance: extends TActiveTextBox
Mostra file Open project: pradosoft/prado

Public Methods

Method Description
__construct ( ) Sets the auto post back to true by default.
getAutoHideTextBox ( ) : boolean
getDisplayTextBox ( ) : boolean
getEditTriggerControlID ( ) : string
onCallback ( $param ) This method is invoked when a callback is requested. The method raises 'OnCallback' 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.
onLoadingText ( $param ) Raised when editing the content is requsted to be loaded from the server side.
onPreRender ( $param ) Registers CSS and JS.
renderContents ( $writer ) Renders the body content of the label.
setAutoHideTextBox ( $value )
setDisplayTextBox ( $value )
setEditTriggerControlID ( $value )
setReadOnly ( $value ) Update ClientSide Readonly property
setText ( $value ) On callback response, the inner HTMl of the label and the value of the textbox is updated

Protected Methods

Method Description
addAttributesToRender ( $writer ) Ensure that the ID attribute is rendered and registers the javascript code for initializing the active control.
callClientFunction ( $func, $value ) Calls the client-side static method for this control class.
getClientClassName ( ) : string
getExternalControlID ( ) : string
getLabelClientID ( ) : string
getPostBackOptions ( ) : array
getTagName ( ) : string
registerClientScript ( ) Registers the relevant JavaScript.

Method Details

__construct() public method

Sets the auto post back to true by default.
public __construct ( )

addAttributesToRender() protected method

Ensure that the ID attribute is rendered and registers the javascript code for initializing the active control.
protected addAttributesToRender ( $writer )

callClientFunction() protected method

Calls the client-side static method for this control class.
protected callClientFunction ( $func, $value )

getAutoHideTextBox() public method

public getAutoHideTextBox ( ) : boolean
return boolean true will hide the textbox after losing focus.

getClientClassName() protected method

protected getClientClassName ( ) : string
return string corresponding javascript class name for this TInPlaceTextBox

getDisplayTextBox() public method

public getDisplayTextBox ( ) : boolean
return boolean true to display the edit textbox

getEditTriggerControlID() public method

public getEditTriggerControlID ( ) : string
return string ID of the control that can trigger to edit the textbox

getExternalControlID() protected method

protected getExternalControlID ( ) : string
return string edit trigger control client ID.

getLabelClientID() protected method

protected getLabelClientID ( ) : string
return string label client ID

getPostBackOptions() protected method

protected getPostBackOptions ( ) : array
return array callback options.

getTagName() protected method

protected getTagName ( ) : string
return string tag name of the label.

onCallback() public method

This method is invoked when a callback is requested. The method raises 'OnCallback' 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 onCallback ( $param )

onLoadingText() public method

Raised when editing the content is requsted to be loaded from the server side.
public onLoadingText ( $param )

onPreRender() public method

This method is invoked right before the control rendering, if the control is visible.
public onPreRender ( $param )

registerClientScript() protected method

Registers the relevant JavaScript.
protected registerClientScript ( )

renderContents() public method

Renders the body content of the label.
public renderContents ( $writer )

setAutoHideTextBox() public method

public setAutoHideTextBox ( $value )

setDisplayTextBox() public method

public setDisplayTextBox ( $value )

setEditTriggerControlID() public method

public setEditTriggerControlID ( $value )

setReadOnly() public method

Update ClientSide Readonly property
Since: 3.1.2
public setReadOnly ( $value )

setText() public method

On callback response, the inner HTMl of the label and the value of the textbox is updated
public setText ( $value )