Packages:
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml


Classes:
IDataSource
IItemDataRenderer
IRepeatInfoUser
TBaseDataList
TBaseValidator
TBoundColumn
TBulletedList
TBulletedListDisplayMode
TBulletedListEventParameter
TBulletStyle
TButton
TButtonColumn
TButtonColumnType
TButtonType
TCaptcha
TCaptchaValidator
TCheckBox
TCheckBoxColumn
TCheckBoxList
TCircleHotSpot
TClientScript
TClientScriptLoader
TClientSideValidationSummaryOptions
TColorPicker
TColorPickerClientSide
TColorPickerMode
TCompareValidator
TCompleteWizardStep
TConditional
TContent
TContentDirection
TContentPlaceHolder
TCustomValidator
TDataBoundControl
TDataGrid
TDataGridColumn
TDataGridColumnCollection
TDataGridCommandEventParameter
TDataGridItem
TDataGridItemCollection
TDataGridItemEventParameter
TDataGridItemRenderer
TDataGridPageChangedEventParameter
TDataGridPager
TDataGridPagerButtonType
TDataGridPagerEventParameter
TDataGridPagerMode
TDataGridPagerPosition
TDataGridPagerStyle
TDataGridSortCommandEventParameter
TDataList
TDataListCommandEventParameter
TDataListItem
TDataListItemCollection
TDataListItemEventParameter
TDataListItemRenderer
TDataRenderer
TDataSourceControl
TDataSourceSelectParameters
TDataSourceView
TDataTypeValidator
TDatePicker
TDatePickerClientScript
TDatePickerInputMode
TDatePickerMode
TDisplayStyle
TDropDownList
TDropDownListColumn
TEditCommandColumn
TEmailAddressValidator
TExpression
TFileUpload
TFont
THiddenField
THorizontalAlign
THotSpot
THotSpotCollection
THotSpotMode
THtmlArea
THtmlElement
THyperLink
THyperLinkColumn
TImage
TImageButton
TImageClickEventParameter
TImageMap
TImageMapEventParameter
TInlineFrame
TInlineFrameAlign
TInlineFrameScrollBars
TItemDataRenderer
TJavascriptLogger
TKeyboard
TLabel
TLinkButton
TListBox
TListControl
TListControlValidator
TListItem
TListItemCollection
TListItemType
TListSelectionMode
TLiteral
TLiteralColumn
TMarkdown
TMetaTag
TMetaTagCollection
TMultiView
TOutputCache
TOutputCacheCalculateKeyEventParameter
TOutputCacheCheckDependencyEventParameter
TPager
TPagerButtonType
TPagerMode
TPagerPageChangedEventParameter
TPanel
TPanelStyle
TPlaceHolder
TPolygonHotSpot
TRadioButton
TRadioButtonList
TRangeValidationDataType
TRangeValidator
TRatingList
TReadOnlyDataSource
TReadOnlyDataSourceView
TRectangleHotSpot
TRegularExpressionValidator
TRepeatDirection
TRepeater
TRepeaterCommandEventParameter
TRepeaterItem
TRepeaterItemCollection
TRepeaterItemEventParameter
TRepeaterItemRenderer
TRepeatInfo
TRepeatLayout
TRequiredFieldValidator
TSafeHtml
TScrollBars
TServerValidateEventParameter
TSlider
TSliderClientScript
TSliderDirection
TStatements
TStyle
TStyleSheet
TTable
TTableCaptionAlign
TTableCell
TTableCellCollection
TTableFooterRow
TTableGridLines
TTableHeaderCell
TTableHeaderRow
TTableHeaderScope
TTableItemStyle
TTableRow
TTableRowCollection
TTableRowSection
TTableStyle
TTabPanel
TTabView
TTabViewCollection
TTemplateColumn
TTemplatedWizardStep
TTextAlign
TTextBox
TTextBoxAutoCompleteType
TTextBoxMode
TTextHighlighter
TTextHighlighterLineNumberStyle
TValidationCompareOperator
TValidationDataType
TValidationSummary
TValidationSummaryDisplayMode
TValidationSummaryDisplayStyle
TValidatorClientSide
TValidatorDisplayStyle
TVerticalAlign
TView
TViewCollection
TWebControl
TWebControlAdapter
TWizard
TWizardFinishNavigationTemplate
TWizardNavigationButtonStyle
TWizardNavigationButtonType
TWizardNavigationContainer
TWizardNavigationEventParameter
TWizardNavigationTemplate
TWizardSideBarListItemTemplate
TWizardSideBarTemplate
TWizardStartNavigationTemplate
TWizardStep
TWizardStepCollection
TWizardStepNavigationTemplate
TWizardStepType
TXmlTransform
Keyword

Class TTextBox

Direct Known Sub-classes:

TTextBox class

TTextBox displays a text box on the Web page for user input. The text displayed in the TTextBox control is determined by the Text property. You can create a SingleLine, a MultiLine, or a Password text box by setting the TextMode property. If the TTextBox control 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. To use AutoComplete feature, set the AutoCompleteType property.

If AutoPostBack is set true, updating the text box and then changing the focus out of it will cause postback action. And if CausesValidation is true, validation will also be processed, which can be further restricted within a ValidationGroup.

WARNING: Be careful if you want to display the text collected via TTextBox. Malicious cross-site script may be injected in. You may use SafeText to prevent this problem.

NOTE: If you set Wrap to false or use AutoCompleteType, the generated HTML output for the textbox will not be XHTML-compatible. Currently, no alternatives are available.

Since: 3.0
Author: Qiang Xue <qiang.xue@gmail.com>
Constants Inherited From TControl
AUTOMATIC_ID_PREFIX, CLIENT_ID_SEPARATOR, CS_CHILD_INITIALIZED, CS_CONSTRUCTED, CS_INITIALIZED, CS_LOADED, CS_PRERENDERED, CS_STATE_LOADED, ID_FORMAT, ID_SEPARATOR, IS_CHILD_CREATED, IS_CREATING_CHILD, IS_DISABLE_THEMING, IS_DISABLE_VIEWSTATE, IS_ID_SET, IS_SKIN_APPLIED, IS_STYLESHEET_APPLIED, RF_ADAPTER, RF_AUTO_BINDINGS, RF_CHILD_STATE, RF_CONTROLS, RF_CONTROLSTATE, RF_DATA_BINDINGS, RF_EVENTS, RF_NAMED_CONTROLS, RF_NAMED_CONTROLS_ID, RF_NAMED_OBJECTS, RF_SKIN_ID,

Method Summary
protected  void
Adds attribute name-value pairs to renderer.
TTextBoxAutoCompleteType
boolean
boolean
boolean
protected  string
Gets the name of the javascript class responsible for performing postback for this control.
integer
string
getData ()
Returns the text content of the TTextBox control.
boolean
Returns a value indicating whether postback has caused the control data change.
boolean
integer
boolean
protected  array
Gets the post back options for this textbox.
boolean
integer
getRows ()
string
protected  mixed
protected  string
string
getText ()
TTextBoxMode
string
mixed
Returns the value to be validated.
boolean
getWrap ()
boolean
loadPostData ( string $key, array $values)
Loads user input data.
void
Raises OnTextChanged event.
void
Raises postdata changed event.
protected  void
renderClientControlScript ( mixed $writer)
Renders the javascript for textbox.
void
Renders the body content of the textbox when it is in MultiLine text mode.
void
void
setAutoPostBack ( boolean $value)
Sets the value indicating if postback automatically.
void
setAutoTrim ( boolean $value)
Sets the value indicating if the input text should be trimmed spaces
void
setCausesValidation ( boolean $value)
void
setColumns ( integer $value)
Sets the display width of the text box in characters.
void
setData ( string $value)
Sets the text content of the TTextBox control.
void
setEnableClientScript ( boolean $value)
void
setMaxLength ( integer $value)
Sets the maximum number of characters allowed in the text box.
void
setPersistPassword ( boolean $value)
void
setReadOnly ( boolean $value)
void
setRows ( integer $value)
Sets the number of rows displayed in a multiline text box.
void
setText ( string $value)
Sets the text content of the TTextBox control.
void
Sets the behavior mode of the TTextBox component.
void
setValidationGroup ( string $value)
void
setWrap ( boolean $value)
Sets the value indicating whether the text content wraps within a multiline text box.
Methods 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()
Methods Inherited From TControl
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()
Methods Inherited From TApplicationComponent
TApplicationComponent::getApplication(), TApplicationComponent::getRequest(), TApplicationComponent::getResponse(), TApplicationComponent::getService(), TApplicationComponent::getSession(), TApplicationComponent::getUser(), TApplicationComponent::publishAsset(), TApplicationComponent::publishFilePath()
Methods 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()

Constant Summary
int DEFAULT_COLUMNS Default number of columns (for MultiLine text box)
int DEFAULT_ROWS Default number of rows (for MultiLine text box)

Method Details

addAttributesToRender

protected void addAttributesToRender (THtmlWriter $writer )

Adds attribute name-value pairs to renderer.

This method overrides the parent implementation with additional textbox specific attributes.

Input
THtmlWriter$writerthe writer used for the rendering purpose
Output
Exception

getAutoCompleteType

public TTextBoxAutoCompleteType getAutoCompleteType ()

Output
TTextBoxAutoCompleteType the AutoComplete type of the textbox
Exception

getAutoPostBack

public boolean getAutoPostBack ()

Output
boolean a value indicating whether an automatic postback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to false.
Exception

getAutoTrim

public boolean getAutoTrim ()

Output
boolean a value indicating whether the input text should be trimmed spaces. Defaults to false.
Exception

getCausesValidation

public boolean getCausesValidation ()

Output
boolean whether postback event trigger by this text box will cause input validation, default is true.
Exception

getClientClassName

protected string getClientClassName ()

Gets the name of the javascript class responsible for performing postback for this control.

This method overrides the parent implementation.

Output
string the javascript class name
Exception

getColumns

public integer getColumns ()

Output
integer the display width of the text box in characters, default is 0 meaning not set.
Exception

getData

public string getData ()

Returns the text content of the TTextBox control.

This method is required by IDataRenderer. It is the same as getText().

Output
string the text content of the TTextBox control.
Exception

getDataChanged

public boolean getDataChanged ()

Returns a value indicating whether postback has caused the control data change.

This method is required by the IPostBackDataHandler interface.

Output
boolean whether postback has caused the control data change. False if the page is not in postback mode.
Exception

getEnableClientScript

public boolean getEnableClientScript ()

Output
boolean whether to render javascript.
Exception

getMaxLength

public integer getMaxLength ()

Output
integer the maximum number of characters allowed in the text box, default is 0 meaning not set.
Exception

getPersistPassword

public boolean getPersistPassword ()

Output
boolean whether password should be displayed in the textbox during postback. Defaults to false. This property only applies when TextMode='Password'.
Exception

getPostBackOptions

protected array getPostBackOptions ()

Gets the post back options for this textbox.

Output
Exception

getReadOnly

public boolean getReadOnly ()

Output
boolean whether the textbox is read only, default is false.
Exception

getRows

public integer getRows ()

Output
integer the number of rows displayed in a multiline text box, default is 4
Exception

getSafeText

public string getSafeText ()

Output
string safe text content with javascript stripped off
Exception

getSafeTextParser

protected mixed getSafeTextParser ()

Output
mixed safe text parser
Exception

getTagName

protected string getTagName ()

Output
string tag name of the textbox
Exception

getText

public string getText ()

Output
string the text content of the TTextBox control.
Exception

getTextMode

public TTextBoxMode getTextMode ()

Output
TTextBoxMode the behavior mode of the TTextBox component. Defaults to TTextBoxMode::SingleLine.
Exception

getValidationGroup

public string getValidationGroup ()

Output
string the group of validators which the text box causes validation upon postback
Exception

getValidationPropertyValue

public mixed getValidationPropertyValue ()

Returns the value to be validated.

This methid is required by IValidatable interface.

Output
mixed the value of the property to be validated.
Exception

getWrap

public boolean getWrap ()

Output
boolean whether the text content wraps within a multiline text box. Defaults to true.
Exception

loadPostData

public boolean loadPostData (string $key , array