Class TWebControl

Description

Implements interfaces:

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 getTagName to specify the tag name, addAttributesToRender to specify the attributes to be rendered, and renderContents to customize the body content rendering. TWebControl encapsulates a set of properties related with CSS style fields, such as BackColor, BorderWidth, etc.

Subclasses of TWebControl typically needs to override addAttributesToRender and 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.

  • since: 3.0
  • version: $Id: TWebControl.php 1672 2007-02-05 02:24:34Z xue $
  • author: Qiang Xue <qiang.xue@gmail.com>

Located in /Web/UI/WebControls/TWebControl.php (line 41)

TComponent
   |
   --TApplicationComponent
      |
      --TControl
         |
         --TWebControl
Direct descendents
Class Description
TButton TButton class
TCheckBox TCheckBox class
TClientScriptLoader The TClientScriptLoader publish a collection of javascript files as assets.
TDataBoundControl TDataBoundControl class.
TDataListItem TDataListItem class
TFileUpload TFileUpload class
THtmlElement THtmlElement class.
THyperLink THyperLink class
TImage TImage class
TInlineFrame TInlineFrame class
TJavascriptLogger TJavascriptLogger class.
TKeyboard Class TKeyboard.
TLabel TLabel class
TLinkButton TLinkButton class
TPager TPager class.
TPanel TPanel class
TSlider TSlider class
TTable TTable class
TTableCell TTableCell class.
TTableRow TTableRow class.
TTabPanel Class TTabPanel.
TTabView TTabView class.
TTextBox TTextBox class
TTextProcessor TTextProcessor class.
TValidationSummary TValidationSummary class
TWizard Class TWizard.
Method Summary
void clearStyle ()
void copyBaseAttributes (TWebControl $control)
string getAccessKey ()
string getBackColor ()
string getBorderColor ()
string getBorderStyle ()
string getBorderWidth ()
string getCssClass ()
string getForeColor ()
boolean getHasStyle ()
string getHeight ()
integer getTabIndex ()
string getTagName ()
string getToolTip ()
string getWidth ()
void render (THtmlWriter $writer)
void renderBeginTag (THtmlWriter $writer)
void renderContents (THtmlWriter $writer)
void renderEndTag (THtmlWriter $writer)
void setAccessKey (string $value)
void setBackColor (string $value)
void setBorderColor (string $value)
void setBorderStyle (string $value)
void setBorderWidth (string $value)
void setCssClass (string $value)
void setDisplay (TDisplayStyle $value)
void setForeColor (string $value)
void setHeight (string $value)
void setStyle (string $value)
void setTabIndex (integer $value)
void setToolTip (string $value)
void setWidth (string $value)
Methods
addAttributesToRender (line 367)

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.

  • access: protected
void addAttributesToRender (THtmlWriter $writer)
  • THtmlWriter $writer: the writer used for the rendering purpose

Redefined in descendants as:
clearStyle (line 289)

Removes all style data.

  • access: public
void clearStyle ()
copyBaseAttributes (line 49)

Copies basic control attributes from another control.

Properties including AccessKey, ToolTip, TabIndex, Enabled and Attributes are copied.

  • access: public
void copyBaseAttributes (TWebControl $control)
createStyle (line 252)

Creates a style object to be used by the control.

This method may be overriden by controls to provide customized style.

  • return: the default style created for TWebControl
  • access: protected
TStyle createStyle ()

Redefined in descendants as:
getAccessKey (line 63)
  • return: the access key of the control
  • access: public
string getAccessKey ()
getBackColor (line 85)
  • return: the background color of the control
  • access: public
string getBackColor ()
getBorderColor (line 104)
  • return: the border color of the control
  • access: public
string getBorderColor ()
getBorderStyle (line 123)
  • return: the border style of the control
  • access: public
string getBorderStyle ()
getBorderWidth (line 142)
  • return: the border width of the control
  • access: public
string getBorderWidth ()
getCssClass (line 223)
  • return: the css class of the control
  • access: public
string getCssClass ()

Redefined in descendants as:
getDisplay (line 207)
  • return: display style of the control, default is TDisplayStyle::Fixed
  • access: public
TDisplayStyle getDisplay ()

Redefined in descendants as:
getFont (line 161)
  • return: the font of the control
  • access: public
TFont getFont ()
getForeColor (line 169)
  • return: the foreground color of the control
  • access: public
string getForeColor ()
getHasStyle (line 242)
  • return: whether the control has defined any style information
  • access: public
boolean getHasStyle ()
getHeight (line 188)
  • return: the height of the control
  • access: public
string getHeight ()
getStyle (line 260)
  • return: the object representing the css style of the control
  • access: public
TStyle getStyle ()
getTabIndex (line 297)
  • return: the tab index of the control
  • access: public
integer getTabIndex ()
getToolTip (line 326)
  • return: the tooltip of the control
  • access: public
string getToolTip ()
getWidth (line 344)
  • return: the width of the control
  • access: public
string getWidth ()
render (line 397)

Renders the control.

This method overrides the parent implementation by replacing it with the following sequence:

  • access: public
void render (THtmlWriter $writer)
  • THtmlWriter $writer: the writer used for the rendering purpose

Redefinition of:
TControl::render()
Renders the control.

Redefined in descendants as:
renderBeginTag (line 408)

Renders the openning tag for the control (including attributes)

  • access: public
void renderBeginTag (THtmlWriter $writer)
  • THtmlWriter $writer: the writer used for the rendering purpose

Redefined in descendants as:
renderContents (line 420)

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.

  • access: public
void renderContents (THtmlWriter $writer)
  • THtmlWriter $writer: the writer used for the rendering purpose

Redefined in descendants as:
renderEndTag (line 429)

Renders the closing tag for the control

  • access: public
void renderEndTag (THtmlWriter $writer)
  • THtmlWriter $writer: the writer used for the rendering purpose

Redefined in descendants as:
setAccessKey (line 75)

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.

  • access: public
  • throws: TInvalidDataValueException if the access key is specified with more than one character
void setAccessKey (string $value)
  • string $value: the access key to be set
setBackColor (line 96)
  • access: public
void setBackColor (string $value)
  • string $value: the background color of the control
setBorderColor (line 115)
  • access: public
void setBorderColor (string $value)
  • string $value: the border color of the control
setBorderStyle (line 134)
  • access: public
void setBorderStyle (string $value)
  • string $value: the border style of the control
setBorderWidth (line 153)
  • access: public
void setBorderWidth (string $value)
  • string $value: the border width of the control
setCssClass (line 215)
  • access: public
void setCssClass (string $value)
  • string $value: the css class of the control
setDisplay (line 199)
  • access: public
void setDisplay (TDisplayStyle $value)
  • TDisplayStyle $value: display style of the control, default is TDisplayStyle::Fixed

Redefined in descendants as:
setForeColor (line 180)
  • access: public
void setForeColor (string $value)
  • string $value: the foreground color of the control
setHeight (line 234)
  • access: public
void setHeight (string $value)
  • string $value: the height of the control
setStyle (line 278)

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).

  • access: public
  • throws: TInvalidDataValueException if the parameter is not a string
void setStyle (string $value)
  • string $value: the css style string
setTabIndex (line 307)

Sets the tab index of the control.

Pass 0 if you want to disable tab index.

  • access: public
void setTabIndex (integer $value)
  • integer $value: the tab index to be set
setToolTip (line 336)

Sets the tooltip of the control.

Pass an empty string if you want to disable tooltip.

  • access: public
void setToolTip (string $value)
  • string $value: the tooltip to be set
setWidth (line 355)
  • access: public
void setWidth (string $value)
  • string $value: the width of the control

Inherited Methods

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

Documentation generated on Mon, 21 Apr 2008 11:36:43 -0400 by phpDocumentor 1.3.0RC4