## Class TInPlaceTextBox

Description

TInPlaceTextBox Class

* 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 EditTriggerControlID is clicked.

If the 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 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 AutoPostBack is true and the textbox content has changed, a callback request is made and the 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 AutoHideTextBox property is true, then the textbox will be hidden and the label is then shown.

Since 3.1.2, you can set the ReadOnly property to make the control not editable. This property can be also changed on callback

- since: 3.1
- version: $Id: TInPlaceTextBox.php 2541 2008-10-21 15:05:13Z qiang.xue $
- author: Wei Zhuo <weizhuo[at]gmail[dot]com>

Located in /Web/UI/ActiveControls/TInPlaceTextBox.php (line 47)

    TComponent
       |
       --TApplicationComponent
          |
          --TControl
             |
             --TWebControl
                |
                --TTextBox
                   |
                   --TActiveTextBox
                      |
                      --TInPlaceTextBox

Method Summary
TInPlaceTextBox __construct ()
void addAttributesToRender (mixed $writer)
void callClientFunction (string $func, mixed $value)
boolean getAutoHideTextBox ()
string getClientClassName ()
boolean getDisplayTextBox ()
string getEditTriggerControlID ()
string getExternalControlID ()
string getLabelClientID ()
array getPostBackOptions ()
string getTagName ()
void onCallback (TCallbackEventParameter $param)
void onLoadingText (TCallbackEventParameter $param)
void renderContents (THtmlWriter $writer)
void setAutoHideTextBox (boolean $value)
void setDisplayTextBox (boolean $value)
void setEditTriggerControlID (string $value)
void setReadOnly (boolean $value)
void setText (string $value)
Methods
Constructor __construct (line 52)

Sets the auto post back to true by default.

- access: public

TInPlaceTextBox __construct ()

Redefinition of:

TActiveTextBox::__construct()
  Creates a new callback control, sets the adapter to TActiveControlAdapter. If you override this class, be sure to set the adapter appropriately by, for example, by calling this constructor.

addAttributesToRender (line 262)

Ensure that the ID attribute is rendered and registers the javascript code for initializing the active control.

- access: protected

void addAttributesToRender (mixed $writer)

Redefinition of:

TActiveTextBox::addAttributesToRender()
  Ensure that the ID attribute is rendered and registers the javascript code for initializing the active control.

callClientFunction (line 98)

Calls the client-side static method for this control class.

- access: protected

void callClientFunction (string $func, mixed $value)

- string $func: static method name
- mixed $value: method parmaeter

getAutoHideTextBox (line 69)

- return: true will hide the textbox after losing focus.
- access: public

boolean getAutoHideTextBox ()
getClientClassName (line 253)

- return: corresponding javascript class name for this TInPlaceTextBox
- access: protected

string getClientClassName ()

Redefinition of:

TActiveTextBox::getClientClassName()
  Gets the name of the javascript class responsible for performing postback for this control.

getDisplayTextBox (line 88)

- return: true to display the edit textbox
- access: public

boolean getDisplayTextBox ()
getEditTriggerControlID (line 116)

- return: ID of the control that can trigger to edit the textbox
- access: public

string getEditTriggerControlID ()
getExternalControlID (line 124)

- return: edit trigger control client ID.
- access: protected

string getExternalControlID ()
getLabelClientID (line 187)

- return: label client ID
- access: protected

string getLabelClientID ()
getPostBackOptions (line 213)

- return: callback options.
- access: protected

array getPostBackOptions ()

Redefinition of:

TTextBox::getPostBackOptions()
  Gets the post back options for this textbox.

getTagName (line 167)

- return: tag name of the label.
- access: protected

string getTagName ()

Redefinition of:

TTextBox::getTagName()

onCallback (line 199)

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.

- access: public

void onCallback (TCallbackEventParameter $param)

- TCallbackEventParameter $param: event parameter to be passed to the event handlers

Redefinition of:

TActiveTextBox::onCallback()
  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 (line 245)

Raised when editing the content is requsted to be loaded from the server side.

- access: public

void onLoadingText (TCallbackEventParameter $param)

- TCallbackEventParameter $param: event parameter to be passed to the event handlers

renderContents (line 176)

Renders the body content of the label.

- access: public

void renderContents (THtmlWriter $writer)

- THtmlWriter $writer: the writer for rendering

Redefinition of:

TTextBox::renderContents()
  Renders the body content of the textbox when it is in MultiLine text mode.

setAutoHideTextBox (line 61)

- access: public

void setAutoHideTextBox (boolean $value)

- boolean $value: true to hide the textbox after losing focus.

setDisplayTextBox (line 77)

- access: public

void setDisplayTextBox (boolean $value)

- boolean $value: true to display the edit textbox

setEditTriggerControlID (line 108)

- access: public

void setEditTriggerControlID (string $value)

- string $value: ID of the control that can trigger to edit the textbox

setReadOnly (line 154)

Update ClientSide Readonly property

- access: public
- since: 3.1.2

void setReadOnly (boolean $value)

- boolean $value: value

Redefinition of:

TTextBox::setReadOnly()

setText (line 138)

On callback response, the inner HTMl of the label and the

value of the textbox is updated

- access: public

void setText (string $value)

- string $value: the text value of the label

Redefinition of:

TActiveTextBox::setText()
  Client-side Text property can only be updated after the OnLoad stage.

#### Inherited Methods

Inherited From TActiveTextBox

> TActiveTextBox::__construct()
> TActiveTextBox::addAttributesToRender()
> TActiveTextBox::getActiveControl()
> TActiveTextBox::getClientClassName()
> TActiveTextBox::getClientSide()
> TActiveTextBox::onCallback()
> TActiveTextBox::raiseCallbackEvent()
> TActiveTextBox::renderClientControlScript()
> TActiveTextBox::setText()

Inherited From TTextBox

> TTextBox::addAttributesToRender()
> TTextBox::getAutoCompleteType()
> TTextBox::getAutoPostBack()
> TTextBox::getAutoTrim()
> TTextBox::getCausesValidation()
> TTextBox::getClientClassName()
> TTextBox::getColumns()
> TTextBox::getData()
> TTextBox::getDataChanged()
> TTextBox::getEnableClientScript()
> TTextBox::getIsValid()
> TTextBox::getMaxLength()
> TTextBox::getPersistPassword()
> TTextBox::getPostBackOptions()
> TTextBox::getReadOnly()
> TTextBox::getRows()
> TTextBox::getSafeText()
> TTextBox::getSafeTextParser()
> TTextBox::getTagName()
> TTextBox::getText()
> TTextBox::getTextMode()
> TTextBox::getValidationGroup()
> TTextBox::getValidationPropertyValue()
> TTextBox::getWrap()
> TTextBox::loadPostData()
> TTextBox::onTextChanged()
> TTextBox::raisePostDataChangedEvent()
> TTextBox::renderClientControlScript()
> TTextBox::renderContents()
> TTextBox::setAutoCompleteType()
> TTextBox::setAutoPostBack()
> TTextBox::setAutoTrim()
> TTextBox::setCausesValidation()
> TTextBox::setColumns()
> TTextBox::setData()
> TTextBox::setEnableClientScript()
> TTextBox::setIsValid()
> TTextBox::setMaxLength()
> TTextBox::setPersistPassword()
> TTextBox::setReadOnly()
> TTextBox::setRows()
> TTextBox::setText()
> TTextBox::setTextMode()
> TTextBox::setValidationGroup()
> TTextBox::setWrap()

Inherited From TWebControl

> TWebControl::addAttributesToRender()
> TWebControl::clearStyle()
> TWebControl::copyBaseAttributes()
> TWebControl::createStyle()
> TWebControl::getAccessKey()
> TWebControl::getBackColor()
> TWebControl::getBorderColor()
> TWebControl::getBorderStyle()
> TWebControl::getBorderWidth()
> TWebControl::getCssClass()
> TWebControl::getDisplay()
> TWebControl::getFont()
> TWebControl::getForeColor()
> TWebControl::getHasStyle()
> TWebControl::getHeight()
> TWebControl::getStyle()
> TWebControl::getTabIndex()
> TWebControl::getTagName()
> TWebControl::getToolTip()
> TWebControl::getWidth()
> TWebControl::render()
> TWebControl::renderBeginTag()
> TWebControl::renderContents()
> TWebControl::renderEndTag()
> TWebControl::setAccessKey()
> TWebControl::setBackColor()
> TWebControl::setBorderColor()
> TWebControl::setBorderStyle()
> TWebControl::setBorderWidth()
> TWebControl::setCssClass()
> TWebControl::setDisplay()
> TWebControl::setForeColor()
> TWebControl::setHeight()
> TWebControl::setStyle()
> TWebControl::setTabIndex()
> TWebControl::setToolTip()
> TWebControl::setWidth()

Inherited From TControl

> TControl::__construct()
> TControl::addedControl()
> TControl::addParsedObject()
> TControl::addToPostDataLoader()
> TControl::applyStyleSheetSkin()
> TControl::autoBindProperty()
> TControl::autoDataBindProperties()
> TControl::bindProperty()
> TControl::broadcastEvent()
> TControl::bubbleEvent()
> TControl::clearChildState()
> TControl::clearControlState()
> TControl::clearNamingContainer()
> TControl::clearViewState()
> TControl::convertUniqueIdToClientId()
> TControl::createChildControls()
> TControl::createControlCollection()
> TControl::dataBind()
> TControl::dataBindChildren()
> TControl::dataBindProperties()
> TControl::ensureChildControls()
> TControl::findControl()
> TControl::findControlsByID()
> TControl::findControlsByType()
> TControl::focus()
> TControl::getAdapter()
> TControl::getAllowChildControls()
> TControl::getAttribute()
> TControl::getAttributes()
> TControl::getChildControlsCreated()
> TControl::getClientID()
> TControl::getControls()
> TControl::getControlStage()
> TControl::getControlState()
> TControl::getCustomData()
> TControl::getEnabled()
> TControl::getEnableTheming()
> TControl::getEnableViewState()
> TControl::getHasAdapter()
> TControl::getHasAttributes()
> TControl::getHasChildInitialized()
> TControl::getHasControls()
> TControl::getHasInitialized()
> TControl::getHasLoaded()
> TControl::getHasLoadedPostData()
> TControl::getHasPreRendered()
> TControl::getID()
> TControl::getNamingContainer()
> TControl::getPage()
> TControl::getParent()
> TControl::getRegisteredObject()
> TControl::getSkinID()
> TControl::getSourceTemplateControl()
> TControl::getTemplateControl()
> TControl::getUniqueID()
> TControl::getViewState()
> TControl::getVisible()
> TControl::hasAttribute()
> TControl::initRecursive()
> TControl::isDescendentOf()
> TControl::isObjectRegistered()
> TControl::loadRecursive()
> TControl::loadState()
> TControl::loadStateRecursive()
> TControl::onDataBinding()
> TControl::onInit()
> TControl::onLoad()
> TControl::onPreRender()
> TControl::onUnload()
> TControl::preRenderRecursive()
> TControl::raiseBubbleEvent()
> TControl::registerObject()
> TControl::removeAttribute()
> TControl::removedControl()
> TControl::render()
> TControl::renderChildren()
> TControl::renderControl()
> TControl::saveState()
> TControl::saveStateRecursive()
> TControl::setAdapter()
> TControl::setAttribute()
> TControl::setChildControlsCreated()
> TControl::setControlStage()
> TControl::setControlState()
> TControl::setCustomData()
> TControl::setEnabled()
> TControl::setEnableTheming()
> TControl::setEnableViewState()
> TControl::setID()
> TControl::setPage()
> TControl::setSkinID()
> TControl::setTemplateControl()
> TControl::setViewState()
> TControl::setVisible()
> TControl::trackViewState()
> TControl::traverseChildControls()
> TControl::unbindProperty()
> TControl::unloadRecursive()
> TControl::unregisterObject()
> TControl::__get()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

Inherited From TComponent

> TComponent::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Class Constants

#### Inherited Constants

Inherited from TTextBox

> TTextBox::DEFAULT_COLUMNS
> TTextBox::DEFAULT_ROWS

Inherited from TControl

> TControl::AUTOMATIC_ID_PREFIX
> TControl::CLIENT_ID_SEPARATOR
> TControl::CS_CHILD_INITIALIZED
> TControl::CS_CONSTRUCTED
> TControl::CS_INITIALIZED
> TControl::CS_LOADED
> TControl::CS_PRERENDERED
> TControl::CS_STATE_LOADED
> TControl::ID_FORMAT
> TControl::ID_SEPARATOR
> TControl::IS_CHILD_CREATED
> TControl::IS_CREATING_CHILD
> TControl::IS_DISABLE_THEMING
> TControl::IS_DISABLE_VIEWSTATE
> TControl::IS_ID_SET
> TControl::IS_SKIN_APPLIED
> TControl::IS_STYLESHEET_APPLIED
> TControl::RF_ADAPTER
> TControl::RF_AUTO_BINDINGS
> TControl::RF_CHILD_STATE
> TControl::RF_CONTROLS
> TControl::RF_CONTROLSTATE
> TControl::RF_DATA_BINDINGS
> TControl::RF_EVENTS
> TControl::RF_NAMED_CONTROLS
> TControl::RF_NAMED_CONTROLS_ID
> TControl::RF_NAMED_OBJECTS
> TControl::RF_SKIN_ID

Documentation generated on Sun, 11 Jan 2009 20:22:51 -0500 by phpDocumentor 1.3.0RC4