PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

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
Extended by TApplicationComponent
Extended by TControl implements IRenderable, IBindable
Extended by 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, TImage

Indirect 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, TActiveFileUpload
Package: System\Web\UI\WebControls
Copyright: 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
Methods summary
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.

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.

Parameters

$value
boolean
pass true to enable enforcement of the tag attribute id.
public whether
# getEnsureId( )

Returns

whether
this web control must have an id
public TWebControlDecorator
# getDecorator( mixed $create = true )

Returns

TWebControlDecorator
public
# copyBaseAttributes( TWebControl $control )

Copies basic control attributes from another control. Properties including AccessKey, ToolTip, TabIndex, Enabled and Attributes are copied.

Copies basic control attributes from another control. Properties including AccessKey, ToolTip, TabIndex, Enabled and Attributes are copied.

Parameters

$control
TWebControl
source control
public string
# getAccessKey( )

Returns

string
the access key of the control
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.

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.

Parameters

$value
string
the access key to be set

Throws

TInvalidDataValueException
if the access key is specified with more than one character
public string
# getBackColor( )

Returns

string
the background color of the control
public
# setBackColor( string $value )

Parameters

$value
string
the background color of the control
public string
# getBorderColor( )

Returns

string
the border color of the control
public
# setBorderColor( string $value )

Parameters

$value
string
the border color of the control
public string
# getBorderStyle( )

Returns

string
the border style of the control
public
# setBorderStyle( string $value )

Parameters

$value
string
the border style of the control
public string
# getBorderWidth( )

Returns

string
the border width of the control
public
# setBorderWidth( string $value )

Parameters

$value
string
the border width of the control
public TFont
# getFont( )

Returns

TFont
the font of the control
public string
# getForeColor( )

Returns

string
the foreground color of the control
public
# setForeColor( string $value )

Parameters

$value
string
the foreground color of the control
public string
# getHeight( )

Returns

string
the height of the control
public
# setDisplay( TDisplayStyle $value )

Parameters

$value
TDisplayStyle
display style of the control, default is TDisplayStyle::Fixed
public TDisplayStyle
# getDisplay( )

Returns

TDisplayStyle
display style of the control, default is TDisplayStyle::Fixed
public
# setCssClass( string $value )

Parameters

$value
string
the css class of the control
public string
# getCssClass( )

Returns

string
the css class of the control
public
# setHeight( string $value )

Parameters

$value
string
the height of the control
public boolean
# getHasStyle( )

Returns

boolean
whether the control has defined any style information

Implementation of

IStyleable::getHasStyle()
protected TStyle
# createStyle( )

Creates a style object to be used by the control. This method may be overriden by controls to provide customized style.

Creates a style object to be used by the control. This method may be overriden by controls to provide customized style.

Returns

TStyle
the default style created for TWebControl
public TStyle
# getStyle( )

Returns

TStyle
the object representing the css style of the control

Implementation of

IStyleable::getStyle()
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).

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

Parameters

$value
string
the css style string

Throws

TInvalidDataValueException
if the parameter is not a string
public
# clearStyle( )

Removes all style data.

Removes all style data.

Implementation of

IStyleable::clearStyle()
public integer
# getTabIndex( )

Returns

integer
the tab index of the control
public
# setTabIndex( integer $value )

Sets the tab index of the control. Pass 0 if you want to disable tab index.

Sets the tab index of the control. Pass 0 if you want to disable tab index.

Parameters

$value
integer
the tab index to be set
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.

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.

Returns

string
tag name of the control to be rendered
public string
# getToolTip( )

Returns

string
the tooltip of the control
public
# setToolTip( string $value )

Sets the tooltip of the control. Pass an empty string if you want to disable tooltip.

Sets the tooltip of the control. Pass an empty string if you want to disable tooltip.

Parameters

$value
string
the tooltip to be set
public string
# getWidth( )

Returns

string
the width of the control
public
# setWidth( string $value )

Parameters

$value
string
the width of the control
public
# onPreRender( TEventParameter $param )

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.

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.

Parameters

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

Overrides

TControl::onPreRender()
protected
# addAttributesToRender( THtmlWriter $writer )

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.

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.

Parameters

$writer
THtmlWriter
the writer used for the rendering purpose
public
# render( THtmlWriter $writer )

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

  • TWebControl::renderBeginTag()
  • TWebControl::renderContents()
  • TWebControl::renderEndTag()

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

  • TWebControl::renderBeginTag()
  • TWebControl::renderContents()
  • TWebControl::renderEndTag()

Parameters

$writer
THtmlWriter
the writer used for the rendering purpose

Overrides

TControl::render()
public
# renderBeginTag( THtmlWriter $writer )

Renders the openning tag for the control (including attributes)

Renders the openning tag for the control (including attributes)

Parameters

$writer
THtmlWriter
the writer used for the rendering purpose
public
# renderContents( THtmlWriter $writer )

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.

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.

Parameters

$writer
THtmlWriter
the writer used for the rendering purpose
public
# renderEndTag( THtmlWriter $writer )

Renders the closing tag for the control

Renders the closing tag for the control

Parameters

$writer
THtmlWriter
the writer used for the rendering purpose
Methods inherited from TControl
__construct(), __get(), addParsedObject(), addToPostDataLoader(), addedControl(), applyStyleSheetSkin(), autoBindProperty(), autoDataBindProperties(), bindProperty(), broadcastEvent(), bubbleEvent(), clearChildState(), clearControlState(), clearNamingContainer(), clearViewState(), convertUniqueIdToClientId(), createChildControls(), createControlCollection(), dataBind(), dataBindChildren(), dataBindProperties(), ensureChildControls(), findControl(), findControlsByID(), findControlsByType(), focus(), getAdapter(), getAllowChildControls(), getAttribute(), getAttributes(), getChildControlsCreated(), getClientID(), getControlStage(), getControlState(), getControls(), getCustomData(), getEnableTheming(), getEnableViewState(), getEnabled(), getHasAdapter(), getHasAttributes(), getHasChildInitialized(), getHasControls(), getHasInitialized(), getHasLoaded(), getHasLoadedPostData(), getHasPreRendered(), getID(), getIsSkinApplied(), getNamingContainer(), getPage(), getParent(), getRegisteredObject(), getSkinID(), getSourceTemplateControl(), getTemplateControl(), getUniqueID(), getViewState(), getVisible(), hasAttribute(), initRecursive(), isDescendentOf(), isObjectRegistered(), loadRecursive(), loadState(), loadStateRecursive(), onDataBinding(), onInit(), onLoad(), onUnload(), preRenderRecursive(), raiseBubbleEvent(), registerObject(), removeAttribute(), removedControl(), renderChildren(), renderControl(), saveState(), saveStateRecursive(), setAdapter(), setAttribute(), setChildControlsCreated(), setControlStage(), setControlState(), setCustomData(), setEnableTheming(), setEnableViewState(), setEnabled(), setID(), setPage(), setSkinID(), setTemplateControl(), setViewState(), setVisible(), trackViewState(), traverseChildControls(), unbindProperty(), unloadRecursive(), unregisterObject()
Methods inherited from TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
Methods inherited from TComponent
__call(), __destruct(), __isset(), __set(), __sleep(), __unset(), __wakeup(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
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
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Properties summary
protected TWebControlDecorator $_decorator
#

this render things before and after both the open and close tag

this render things before and after both the open and close tag

Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO