Class TWebControl

Description

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.

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

TComponent
   |
   --TApplicationComponent
      |
      --TControl
         |
         --TWebControl
Direct descendents
Class Description
TButton TButton class
TCheckBox TCheckBox class
TDataBoundControl TDataBoundControl class.
TDataListItem TDataListItem class
TFileUpload TFileUpload class
THyperLink THyperLink class
TImage TImage class
TInlineFrame TInlineFrame class
TJavascriptLogger TJavascriptLogger class.
TLabel TLabel class
TLinkButton TLinkButton class
TPanel TPanel class
TTable TTable class
TTableCell TTableCell class.
TTableRow TTableRow class.
TTextBox TTextBox class
TTextProcessor TTextProcessor class.
TValidationSummary TValidationSummary class
TWizard Class TWizard.
Method Summary
void copyBaseAttributes (TWebControl $control)
void createStyle ()
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 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 342)

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:
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 235)

Creates a style object to be used by the control.

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

  • access: protected
void 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 207)
  • return: the css class of the control
  • access: public
string getCssClass ()
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 226)
  • 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 243)
  • return: the object representing the css style of the control
  • access: public
TStyle getStyle ()
getTabIndex (line 272)
  • return: the tab index of the control
  • access: public
integer getTabIndex ()
getToolTip (line 301)
  • return: the tooltip of the control
  • access: public
string getToolTip ()
getWidth (line 319)
  • return: the width of the control
  • access: public
string getWidth ()
render (line 372)

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

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

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

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 199)
  • access: public
void setCssClass (string $value)
  • string $value: the css class of the control
setForeColor (line 180)
  • access: public
void setForeColor (string $value)
  • string $value: the foreground color of the control
setHeight (line 218)
  • access: public
void setHeight (string $value)
  • string $value: the height of the control
setStyle (line 261)

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

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

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 330)
  • 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::applyStyleSheetSkin()
TControl::autoBindProperty()
TControl::autoDataBindProperties()
TControl::bindProperty()
TControl::broadcastEvent()
TControl::broadcastEventInternal()
TControl::bubbleEvent()
TControl::clearChildState()
TControl::clearControlState()
TControl::clearNamingContainer()
TControl::clearViewState()
TControl::createChildControls()
TControl::createControlCollection()
TControl::createdOnTemplate()
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::getEnabled()
TControl::getEnableTheming()
TControl::getEnableViewState()
TControl::getHasAdapter()
TControl::getHasAttributes()
TControl::getHasControls()
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::setEnabled()
TControl::setEnableTheming()
TControl::setEnableViewState()
TControl::setID()
TControl::setPage()
TControl::setSkinID()
TControl::setTemplateControl()
TControl::setViewState()
TControl::setVisible()
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::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
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 TControl

Documentation generated on Sun, 04 Jun 2006 19:00:39 -0400 by phpDocumentor 1.3.0RC4