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
Afficher le fichier Open project: pradosoft/prado

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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 méthode

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

addAttributesToRender() protected méthode

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

callClientFunction() protected méthode

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

getAutoHideTextBox() public méthode

public getAutoHideTextBox ( ) : boolean
Résultat boolean true will hide the textbox after losing focus.

getClientClassName() protected méthode

protected getClientClassName ( ) : string
Résultat string corresponding javascript class name for this TInPlaceTextBox

getDisplayTextBox() public méthode

public getDisplayTextBox ( ) : boolean
Résultat boolean true to display the edit textbox

getEditTriggerControlID() public méthode

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

getExternalControlID() protected méthode

protected getExternalControlID ( ) : string
Résultat string edit trigger control client ID.

getLabelClientID() protected méthode

protected getLabelClientID ( ) : string
Résultat string label client ID

getPostBackOptions() protected méthode

protected getPostBackOptions ( ) : array
Résultat array callback options.

getTagName() protected méthode

protected getTagName ( ) : string
Résultat string tag name of the label.

onCallback() public méthode

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 méthode

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

onPreRender() public méthode

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

registerClientScript() protected méthode

Registers the relevant JavaScript.
protected registerClientScript ( )

renderContents() public méthode

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

setAutoHideTextBox() public méthode

public setAutoHideTextBox ( $value )

setDisplayTextBox() public méthode

public setDisplayTextBox ( $value )

setEditTriggerControlID() public méthode

public setEditTriggerControlID ( $value )

setReadOnly() public méthode

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

setText() public méthode

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