System.Web.UI.WebControls
[ class tree: System.Web.UI.WebControls ] [ index: System.Web.UI.WebControls ] [ all elements ]

Class: TTextBox

Source Location: /Web/UI/WebControls/TTextBox.php

Class Overview

TComponent
   |
   --TControl
      |
      --TWebControl
         |
         --TTextBox

TTextBox class

Class Details

[line 74]
TTextBox class

TTextBox displays a text box on the Web page for user input. The text displayed in the TTextBox component is specified or determined by using the Text property. You can create a SingleLine, a MultiLine, or a Password text box by setting the TextMode property. If the TTextBox component is a multiline text box, the number of rows it displays is determined by the Rows property, and the Wrap property can be used to determine whether to wrap the text in the component.

To specify the display width of the text box, in characters, set the Columns property. To prevent the text displayed in the component from being modified, set the ReadOnly property to true. If you want to limit the user input to a specified number of characters, set the MaxLength property.

Note, Text will be HTML encoded before it is displayed in the TTextBox component. If you don't want it to be so, set EncodeText to false.

Namespace: System.Web.UI.WebControls

Properties

  • Text, string, kept in viewstate
    Gets or sets the text content of the TTextBox component.
  • EncodeText, boolean, default=true, kept in viewstate
    Gets or sets the value indicating whether Text should be HTML-encoded when rendering.
  • TextMode, string, kept in viewstate
    Gets or sets the behavior mode (SingleLine, MultiLine, or Password) of the TTextBox component.
  • MaxLength, integer, default=0, kept in viewstate
    Gets or sets the maximum number of characters allowed in the text box.
  • Columns, integer, default=0, kept in viewstate
    Gets or sets the display width of the text box in characters.
  • Rows, integer, default=0, kept in viewstate
    Gets or sets the number of rows displayed in a multiline text box.
  • ReadOnly, boolean, default=false, kept in viewstate
    Gets or sets a value indicating whether the contents of the TTextBox component can be changed.
  • Wrap, boolean, default=true, kept in viewstate
    Gets or sets a value indicating whether the text content wraps within a multiline text box.
  • AutoTrim, boolean, default=false, kept in viewstate
    Gets or sets a value indicating whether the input text should be trimmed space on both sides automatically by the framework. will occur whenever the user modifies the text in the TTextBox component and then tabs out of the component.
  • AutoPostBack, boolean, default=false, kept in viewstate
    Gets or sets a value indicating whether an automatic postback to the server will occur whenever the user modifies the text in the TTextBox component and then tabs out of the component.
Events
  • OnTextChanged Occurs when the content of the TTextBox component is changed.




version:  v1.0, last update on 2004/08/13 21:44:52
author:  Qiang Xue <qiang.xue@gmail.com>


[ Top ]

Methods


Child classes:

TAutoComplete
TAutoComplete class, a textbox with "auto-suggest" feature.
TDatePicker
TDatePicker class
THtmlArea
THtmlArea class

Inherited Variables

Inherited Methods

Class: TWebControl

TWebControl::appendJavascriptEvent()
Append a javascript statement to a particular attribute, e.g. "onclick".
TWebControl::getAccessKey()
TWebControl::getAttributesToRender()
This overrides the parent implementation by rendering more TWebControl-specific attributes.
TWebControl::getBackColor()
TWebControl::getBorderColor()
TWebControl::getBorderStyle()
TWebControl::getBorderWidth()
TWebControl::getCssClass()
TWebControl::getForeColor()
TWebControl::getHeight()
TWebControl::getJavascriptEvents()
Get the list of all the javascript statements.
TWebControl::getStyle()
TWebControl::getTabIndex()
TWebControl::getToolTip()
TWebControl::getWidth()
TWebControl::isEnabled()
TWebControl::parseStyle()
Parses a CSS style string into an array representation.
TWebControl::removeJavascriptEvent()
Remove all or a particular javascript statements.
TWebControl::setAccessKey()
Sets the access key of the control.
TWebControl::setBackColor()
Sets the background color of the control
TWebControl::setBorderColor()
Sets the border color of the control
TWebControl::setBorderStyle()
Sets the border style of the control
TWebControl::setBorderWidth()
Sets the border width of the control
TWebControl::setCssClass()
Sets the CSS class name of the control
TWebControl::setEnabled()
Enables or disables a control.
TWebControl::setForeColor()
Sets the foreground color of the control
TWebControl::setHeight()
Sets the height of the control
TWebControl::setStyle()
Sets the CSS style of the control.
TWebControl::setTabIndex()
Sets the tab index of the control.
TWebControl::setToolTip()
Sets the tooltip of the control.
TWebControl::setWidth()
Sets the width of the control

Class: TControl

TControl::__construct()
Constructor.
TControl::addBody()
Appends an object into the body collection of this control.
TControl::addParsedObject()
Adds the object parsed in template as a body of the component.
TControl::allowBody()
Determines whether the control can add the object as a body.
TControl::clearViewState()
Clears viewstate
TControl::findBodyControl()
TControl::getAttribute()
TControl::getAttributes()
Returns the attribute list object.
TControl::getAttributesToRender()
Returns attributes to be rendered.
TControl::getBodies()
TControl::getClientID()
Returns the client ID of the component.
TControl::getContainer()
Returns the container of this component.
TControl::getSkinName()
TControl::getTagName()
TControl::getViewState()
Returns a viewstate value.
TControl::initSkin()
Initializes a skin for the control. If a skin name is provided then that skin will be loaded.
TControl::isViewStateEnabled()
TControl::isVisible()
This method checks whether a control is visible.
TControl::loadViewState()
Loads viewstate into this component and its children.
TControl::onBubbleEvent()
This method responds to a bubbled event.
TControl::onInit()
This method is invoked when the control enters 'Init' stage.
TControl::onInitRecursive()
Calls onInit of this control and its children recursively.
TControl::onLoad()
This method is invoked when the control enters 'Load' stage.
TControl::onLoadRecursive()
Calls onLoad of this control and its children recursively.
TControl::onPreRender()
This method is invoked when the control enters 'PreRender' stage.
TControl::onPreRenderRecursive()
Calls onPreRender of this control and its children recursively.
TControl::onUnload()
This method is invoked when the control enters 'Unload' stage.
TControl::onUnloadRecursive()
Calls onUnload of this control and its children recursively.
TControl::raiseBubbleEvent()
Invokes the parent's onBubbleEvent method.
TControl::removeBodies()
Removes all body content.
TControl::render()
Renders this control.
TControl::renderAttributes()
Renders the attributes.
TControl::renderBody()
Renders the body content.
TControl::saveViewState()
Returns the viewstate of this component and its children.
TControl::setAttribute()
Sets an attribute.
TControl::setContainer()
Sets the container of this component
TControl::setEnableViewState()
TControl::setSkinName()
Sets the skin to use for this control
TControl::setTagName()
Sets the tag name.
TControl::setViewState()
Sets a viewstate value.
TControl::setVisible()
TControl::synchronizeControl()
This method should only be used by framework developer.

Class: TComponent

TComponent::__construct()
Constructor.
TComponent::addChild()
Adds a child component.
TComponent::addParsedObject()
Handles a component or string met in template.
TComponent::attachEventHandler()
Attaches a handler function to an event.
TComponent::bindProperty()
Sets up the binding between a property and an expression.
TComponent::canGetProperty()
Determines whether a property can be read.
TComponent::canSetProperty()
Determines whether a property can be written.
TComponent::createComponent()
Creates a child component.
TComponent::dataBind()
Performs the databinding for this component.
TComponent::evaluateExpression()
Evaluates a PHP expression.
TComponent::evaluateStatements()
Evaluates a list of PHP statements.
TComponent::findObject()
Finds an object by its ID path.
TComponent::getApplication()
TComponent::getChild()
TComponent::getChildren()
TComponent::getDefinition()
Returns or builds a component definition.
TComponent::getGlobalization()
Returns the Globalization instance for the application.
TComponent::getID()
TComponent::getModule()
Returns the module object that contains the component or the page containing the component.
TComponent::getPage()
TComponent::getParent()
TComponent::getPropertyInitValue()
Gets the initial value of a property.
TComponent::getPropertyType()
Returns the type of a property
TComponent::getRequest()
Returns the request object associated with application.
TComponent::getServiceManager()
Returns the service manager for this application.
TComponent::getSession()
Returns the session object associated with the application.
TComponent::getSessionState()
Returns a session variable.
TComponent::getUniqueID()
Returns the unique ID of the component.
TComponent::getUser()
Returns the user object associated with the application.
TComponent::hasChildren()
TComponent::hasEvent()
Determines whether an event is defined.
TComponent::hasProperty()
Determines whether a property is defined.
TComponent::initProperties()
Initializes the property values.
TComponent::instantiateTemplate()
Parses a template string and instantiates the content.
TComponent::onDataBinding()
This method is invoked when dataBind is invoked for the component.
TComponent::raiseEvent()
Invokes all attached event handler functions for a particular event.
TComponent::removeChild()
Removes a child component.
TComponent::removeChildren()
Removes all child components.
TComponent::setAttribute()
Sets an attribute.
TComponent::setDefinition()
Sets a component definition.
TComponent::setID()
Sets a component ID.
TComponent::setParent()
Sets the parent of this component.
TComponent::setPropertyInitValue()
Sets the initial value of a property.
TComponent::setRoot()
Sets the root component in the component hierarchy.
TComponent::setSessionState()
Sets a session variable.
TComponent::unbindProperty()
Breaks the binding between a property and an expression.
TComponent::__get()
Returns a property value by name or a child component by ID.
TComponent::__set()
Sets value of a component property.

Class Methods


method allowBody [line 81]

boolean allowBody( mixed $object)

Overrides parent implementation to disable body addition.



access:  public


Overridden in child classes as:

TDatePicker::allowBody()
Overrides parent implementation to disable body addition.

Overrides TControl::allowBody() (Determines whether the control can add the object as a body.)

Parameters:

mixed   $object   the object to be added

[ Top ]

method getAttributesToRender [line 322]

ArrayObject getAttributesToRender( )

Returns the attributes to be rendered.

This method overrides the parent's implementation.




return:  attributes to be rendered
access:  protected


Overrides TWebControl::getAttributesToRender() (This overrides the parent implementation by rendering more TWebControl-specific attributes.)

[ Top ]

method getColumns [line 197]

integer getColumns( )



return:  the display width of the text box in characters.
access:  public


[ Top ]

method getMaxLength [line 214]

integer getMaxLength( )



return:  the maximum number of characters allowed in the text box.
access:  public


[ Top ]

method getRows [line 180]

integer getRows( )



return:  the number of rows displayed in a multiline text box.
access:  public


[ Top ]

method getText [line 144]

string getText( )



return:  the text content of the TTextBox component.
access:  public


[ Top ]

method getTextMode [line 161]

string getTextMode( )



return:  the behavior mode (SingleLine, MultiLine, or Password) of the TTextBox component.
access:  public


Overridden in child classes as:

THtmlArea::getTextMode()
Overrides the parent implementation.

[ Top ]

method getValidationPropertyValue [line 136]

mixed getValidationPropertyValue( )

Returns the value of the property that needs validation.



return:  the property value to be validated
access:  public


[ Top ]

method isAutoPostBack [line 301]

boolean isAutoPostBack( )



return:  a value indicating whether an automatic postback to the server will occur whenever the user modifies the text in the TTextBox component and then tabs out of the component.
access:  public


[ Top ]

method isAutoTrim [line 281]

boolean isAutoTrim( )



return:  a value indicating whether the input text should be trimmed spaces
access:  public


[ Top ]

method isEncodeText [line 264]

boolean isEncodeText( )



return:  whether the text should be HTML encoded before rendering
access:  public


[ Top ]

method isReadOnly [line 231]

boolean isReadOnly( )



return:  whether the textbox is read only
access:  public


[ Top ]

method isWrap [line 247]

boolean isWrap( )



return:  whether the text content wraps within a multiline text box.
access:  public


[ Top ]

method loadPostData [line 93]

boolean loadPostData( string $key, array &$values)

Loads user input data.

This method is primarly used by framework developers.




return:  whether the data of the component has been changed
access:  public


Parameters:

string   $key   the key that can be used to retrieve data from the input data collection
array   &$values   the input data collection

[ Top ]

method onTextChanged [line 127]

void onTextChanged( TEventParameter $param)

This method is invoked when the value of the Text property changes between posts to the server.

The method raises 'OnTextChanged' event to fire up the event delegates. If you override this method, be sure to call the parent implementation so that the event delegates can be invoked.




access:  public


Parameters:

TEventParameter   $param   event parameter to be passed to the event handlers

[ Top ]

method raisePostDataChangedEvent [line 115]

void raisePostDataChangedEvent( )

Raises postdata changed event.

This method calls onTextChanged method. This method is primarly used by framework developers.




access:  public


[ Top ]

method render [line 360]

string render( )

Renders the text box



return:  the rendering result
access:  public


Overridden in child classes as:

TAutoComplete::render()
TDatePicker::render()
Renders the datepicker
THtmlArea::render()
Renders the HTMLArea

Overrides TControl::render() (Renders this control.)

[ Top ]

method setAutoPostBack [line 312]

void setAutoPostBack( boolean $value)

Sets the value indicating if postback automatically.

An automatic postback to the server will occur whenever the user modifies the text in the TTextBox component and then tabs out of the component.




access:  public


Parameters:

boolean   $value   the value indicating if postback automatically

[ Top ]

method setAutoTrim [line 290]

void setAutoTrim( boolean $value)

Sets the value indicating if the input text should be trimmed spaces



access:  public


Parameters:

boolean   $value   the value indicating if the input text should be trimmed spaces

[ Top ]

method setColumns [line 206]

void setColumns( integer $value)

Sets the display width of the text box in characters.



access:  public


Parameters:

integer   $value   the display width

[ Top ]

method setEncodeText [line 273]

void setEncodeText( boolean $value)

Sets the value indicating whether the text should be HTML encoded before rendering



access:  public


Parameters:

boolean   $value   whether the text should be HTML encoded before rendering

[ Top ]

method setMaxLength [line 223]

void setMaxLength( integer $value)

Sets the maximum number of characters allowed in the text box.



access:  public


Parameters:

integer   $value   the maximum length

[ Top ]

method setReadOnly [line 239]

void setReadOnly( boolean $value)



access:  public


Parameters:

boolean   $value   whether the textbox is read only

[ Top ]

method setRows [line 189]

void setRows( integer $value)

Sets the number of rows displayed in a multiline text box.



access:  public


Parameters:

integer   $value   the number of rows

[ Top ]

method setText [line 153]

void setText( string $value)

Sets the text content of the TTextBox component.



access:  public


Parameters:

string   $value   the text content

[ Top ]

method setTextMode [line 170]

void setTextMode( string $value)

Sets the behavior mode (SingleLine, MultiLine, or Password) of the TTextBox component.



access:  public


Overridden in child classes as:

THtmlArea::setTextMode()
Overrides the parent implementation.

Parameters:

string   $value   the text mode

[ Top ]

method setWrap [line 256]

void setWrap( boolean $value)

Sets the value indicating whether the text content wraps within a multiline text box.



access:  public


Parameters:

boolean   $value   whether the text content wraps within a multiline text box.

[ Top ]


© 2004-2005 PRADO Software Group. All Rights Reserved.