Class TWebControl
TWebControl class
TWebControl is the base class for controls that share a common set of
UI-related properties and methods. TWebControl-derived controls are usually
associated with HTML tags. They thus have tag name, attributes and body
contents. You can override TWebControl::getTagName()
to specify the tag name, TWebControl::addAttributesToRender()
to specify the attributes to be rendered, and TWebControl::renderContents()
to customize the body content rendering. TWebControl
encapsulates a set of properties related with CSS style fields, such as getBackColor BackColor, getBorderWidth BorderWidth, etc.
Subclasses of TWebControl typically needs to override TWebControl::addAttributesToRender()
and TWebControl::renderContents()
. The former is used to render
the attributes of the HTML tag associated with the control, while the latter is
to render the body contents enclosed within the HTML tag.
- TComponent
-
TApplicationComponent
-
TControl implements IRenderable, IBindable
-
TWebControl implements IStyleable
Direct known subclasses
TAccordion, TAccordionView, TInlineFrame, TJavascriptLogger, TKeyboard, TLabel, TLinkButton, TPager, TPanel, TReCaptcha, TSlider, TTable, TButton, TTableCell, TTableRow, TTabPanel, TTabView, TTextBox, TTextProcessor, TValidationSummary, TWizard, TCheckBox, TDataBoundControl, TDataListItem, TFileUpload, THtmlElement, THyperLink, TImageIndirect known subclasses
TActiveButton, TActiveCheckBox, TActiveHyperLink, TActiveImage, TActiveImageButton, TActiveLabel, TActiveLinkButton, TActiveListBox, TActivePager, TActivePanel, TActiveRadioButton, TActiveRadioButtonList, TActiveCheckBoxList, TActiveRatingList, TActiveRepeater, TActiveTableCell, TActiveTableRow, TActiveTextBox, TAutoComplete, TBaseDataList, TBaseValidator, TBulletedList, TCaptcha, TActiveCustomValidator, TCaptchaValidator, TCheckBoxList, TColorPicker, TCompareValidator, TCustomValidator, TDataGrid, TDataGridItem, TDataGridPager, TDataList, TDataTypeValidator, TActiveDataGrid, TDatePicker, TDraggable, TDropContainer, TDropDownList, TEmailAddressValidator, THeader1, THeader2, THeader3, THeader4, THeader5, TActiveDataGridPager, THeader6, THtmlArea, THtmlArea4, TImageButton, TImageMap, TInPlaceTextBox, TListBox, TListControl, TListControlValidator, TMarkdown, TActiveDataList, TRadioButton, TRadioButtonList, TRangeValidator, TRatingList, TReCaptchaValidator, TRegularExpressionValidator, TRepeater, TRequiredFieldValidator, TTableFooterRow, TTableHeaderCell, TActiveDatePicker, TTableHeaderRow, TTextHighlighter, TActiveDropDownList, TActiveFileUploadCopyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at Web/UI/WebControls/TWebControl.php
public
|
#
setEnsureId( boolean $value )
Subclasses can override getEnsureId or just set this property. eg. If your subclass control does work with javascript and your class wants to flag that it requires an id to operate properly. Once set to true, it stays that way. |
public
whether
|
|
public
|
|
public
|
#
copyBaseAttributes(
Copies basic control attributes from another control. Properties including AccessKey, ToolTip, TabIndex, Enabled and Attributes are copied. |
public
string
|
|
public
|
#
setAccessKey( string $value )
Sets the access key of the control. Only one-character string can be set, or an exception will be raised. Pass in an empty string if you want to disable access key. |
public
string
|
|
public
|
|
public
string
|
|
public
|
|
public
string
|
|
public
|
|
public
string
|
|
public
|
|
public
|
|
public
string
|
|
public
|
|
public
string
|
|
public
|
|
public
|
|
public
|
|
public
string
|
|
public
|
|
public
boolean
|
|
protected
|
#
createStyle( )
Creates a style object to be used by the control. This method may be overriden by controls to provide customized style. |
public
|
|
public
|
#
setStyle( string $value )
Sets the css style string of the control. The style string will be prefixed to the styles set via other control properties (e.g. Height, Width). |
public
|
|
public
integer
|
|
public
|
#
setTabIndex( integer $value )
Sets the tab index of the control. Pass 0 if you want to disable tab index. |
protected
string
|
#
getTagName( )
Returns the tag name used for this control. By default, the tag name is 'span'. You can override this method to provide customized tag names. |
public
string
|
|
public
|
#
setToolTip( string $value )
Sets the tooltip of the control. Pass an empty string if you want to disable tooltip. |
public
string
|
|
public
|
|
public
|
#
onPreRender(
If your subclass overrides the onPreRender method be sure to call this method through parent::onPreRender($param); so your sub-class can be decorated, among other things. |
protected
|
#
addAttributesToRender(
Adds attribute name-value pairs to renderer. By default, the method will render 'id', 'accesskey', 'disabled', 'tabindex', 'title' and all custom attributes. The method can be overriden to provide customized attribute rendering. |
public
|
#
render(
Renders the control. This method overrides the parent implementation by replacing it with the following sequence: |
public
|
#
renderBeginTag(
Renders the openning tag for the control (including attributes) |
public
|
#
renderContents(
Renders the body content enclosed between the control tag. By default, child controls and text strings will be rendered. You can override this method to provide customized content rendering. |
public
|
getApplication(),
getRequest(),
getResponse(),
getService(),
getSession(),
getUser(),
publishAsset(),
publishFilePath()
|
GLOBAL_RAISE_EVENT_LISTENER
|
protected
|
$_decorator |
|
#
this render things before and after both the open and close tag |