Class TTabPanel

Description

Implements interfaces:

Class TTabPanel.

TTabPanel displays a tabbed panel. Users can click on the tab bar to switching among different tab views. Each tab view is an independent panel that can contain arbitrary content.

If the AutoSwitch property is enabled, the user will be able to switch the active view to another one just hovering its corresponding tab caption.

A TTabPanel control consists of one or several TTabView controls representing the possible tab views. At any time, only one tab view is visible (active), which is specified by any of the following properties:

If both ActiveViewIndex and ActiveViewID are set, the latter takes precedence.

TTabPanel uses CSS to specify the appearance of the tab bar and panel. By default, an embedded CSS file will be published which contains the default CSS for TTabPanel. You may also use your own CSS file by specifying the CssUrl property. The following properties specify the CSS classes used for elements in a TTabPanel:

  • CssClass - the CSS class name for the outer-most div element (defaults to 'tab-panel');
  • TabCssClass - the CSS class name for nonactive tab div elements (defaults to 'tab-normal');
  • ActiveTabCssClass - the CSS class name for the active tab div element (defaults to 'tab-active');
  • ViewCssClass - the CSS class for the div element enclosing view content (defaults to 'tab-view');
To use TTabPanel, write a template like following:
  1.  <com:TTabPanel>
  2.    <com:TTabView Caption="View 1">
  3.      content for view 1
  4.    </com:TTabView>
  5.    <com:TTabView Caption="View 2">
  6.      content for view 2
  7.    </com:TTabView>
  8.    <com:TTabView Caption="View 3">
  9.      content for view 3
  10.    </com:TTabView>
  11.  </com:TTabPanel>

  • author: Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
  • version: $Id: TTabPanel.php 3161 2012-06-04 08:47:39Z ctrlaltca $
  • since: 3.1.1

Located in /Web/UI/WebControls/TTabPanel.php (line 61)

TComponent
   |
   --TApplicationComponent
      |
      --TControl
         |
         --TWebControl
            |
            --TTabPanel
Method Summary
void activateView (TTabView $view)
void addParsedObject (mixed $object)
string getActiveViewID ()
integer getActiveViewIndex ()
bool getAutoSwitch ()
string getClientClassName ()
array getClientOptions ()
string getCssClass ()
string getCssUrl ()
boolean getDataChanged ()
string getTabCssClass ()
string getTagName ()
string getViewCssClass ()
boolean loadPostData (string $key, array $values)
void onPreRender (mixed $param)
void render ( $writer)
void renderContents (THtmlWriter $writer)
void setActiveTabCssClass (string $value)
void setActiveView (TTabView $view)
void setActiveViewID (string $value)
void setActiveViewIndex (integer $value)
void setAutoSwitch (bool $value)
void setCssUrl (string $value)
void setTabCssClass (string $value)
void setViewCssClass (string $value)
Variables

Inherited Variables

Inherited from TWebControl

TWebControl::$_decorator
Methods
activateView (line 314)

Activates the specified view.

If there is any other view currently active, it will be deactivated.

  • access: protected
void activateView (TTabView $view)
  • TTabView $view: the view to be activated. If null, all views will be deactivated.
addAttributesToRender (line 380)

Adds attributes to renderer.

  • access: protected
void addAttributesToRender (THtmlWriter $writer)

Redefinition of:
TWebControl::addAttributesToRender()
Adds attribute name-value pairs to renderer.
addParsedObject (line 79)

Adds object parsed from template to the control.

This method adds only TTabView objects into the Views collection. All other objects are ignored.

  • access: public
void addParsedObject (mixed $object)
  • mixed $object: object parsed from template

Redefinition of:
TControl::addParsedObject()
Adds the object instantiated on a template to the child control collection.
createControlCollection (line 480)

Creates a control collection object that is to be used to hold child controls

  • return: control collection
  • access: protected
TTabViewCollection createControlCollection ()

Redefinition of:
TControl::createControlCollection()
Creates a control collection object that is to be used to hold child controls
getActiveTabCssClass (line 282)
  • return: CSS class for the active tab. Defaults to 'tab-active'.
  • access: public
string getActiveTabCssClass ()
getActiveTabStyle (line 298)
  • return: the style for the active tab div
  • access: public
TStyle getActiveTabStyle ()
getActiveView (line 131)

Returns the currently active view.

This method will examin the ActiveViewID, ActiveViewIndex and Views collection to determine which view is currently active. It will update ActiveViewID and ActiveViewIndex accordingly.

  • return: the currently active view, null if no active view
  • throws: TInvalidDataValueException if the active view ID or index set previously is invalid
  • access: public
TTabView getActiveView ()
getActiveViewID (line 111)

Returns the ID of the active tab view.

Note, this property may not return the correct ID. To ensure the correctness, call getActiveView() first.

  • return: The ID of the active tab view. Defaults to '', meaning not set.
  • access: public
string getActiveViewID ()
getActiveViewIndex (line 91)

Returns the index of the active tab view.

Note, this property may not return the correct index. To ensure the correctness, call getActiveView() first.

  • return: the zero-based index of the active tab view. If -1, it means no active tab view. Default is 0 (the first view is active).
  • access: public
integer getActiveViewIndex ()
getAutoSwitch (line 180)
  • return: status of automatic tab switch on hover
  • access: public
bool getAutoSwitch ()
getClientClassName (line 449)

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

This method overrides the parent implementation.

  • return: the javascript class name
  • access: protected
string getClientClassName ()
getClientOptions (line 457)
  • return: the options for JavaScript
  • access: protected
array getClientOptions ()
getCssClass (line 213)
  • return: CSS class for the whole tab control div. Defaults to 'tab-panel'.
  • access: public
string getCssClass ()

Redefinition of:
TWebControl::getCssClass()
getCssUrl (line 197)
  • return: URL for the CSS file including all relevant CSS class definitions. Defaults to ''.
  • access: public
string getCssUrl ()
getDataChanged (line 371)

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

This method is required by the IPostBackDataHandler interface.

  • return: whether postback has caused the control data change. False if the page is not in postback mode.
  • access: public
boolean getDataChanged ()
getTabCssClass (line 252)
  • return: CSS class for non-active tabs. Defaults to 'tab-normal'.
  • access: public
string getTabCssClass ()
getTabStyle (line 268)
  • return: the style for all the inactive tab div
  • access: public
TStyle getTabStyle ()
getTagName (line 68)
  • return: tag name for the control
  • access: protected
string getTagName ()

Redefinition of:
TWebControl::getTagName()
Returns the tag name used for this control.
getViewCssClass (line 222)
  • return: CSS class for the currently displayed view div. Defaults to 'tab-view'.
  • access: public
string getViewCssClass ()
getViews (line 488)
  • return: list of TTabView controls
  • access: public
TTabViewCollection getViews ()
getViewStyle (line 238)
  • return: the style for all the view div
  • access: public
TStyle getViewStyle ()
loadPostData (line 338)

Loads user input data.

This method is primarly used by framework developers.

  • return: whether the data of the control has been changed
  • access: public
boolean loadPostData (string $key, array $values)
  • string $key: the key that can be used to retrieve data from the input data collection
  • array $values: the input data collection
onPreRender (line 392)

Registers CSS and JS.

This method is invoked right before the control rendering, if the control is visible.

  • access: public
void onPreRender (mixed $param)
  • mixed $param: event parameter

Redefinition of:
TWebControl::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.
raisePostDataChangedEvent (line 361)

Raises postdata changed event.

This method is required by IPostBackDataHandler interface. It is invoked by the framework when ActiveViewIndex property is changed on postback. This method is primarly used by framework developers.

  • access: public
void raisePostDataChangedEvent ()
registerClientScript (line 428)

Registers the relevant JavaScript.

  • access: protected
void registerClientScript ()
registerStyleSheet (line 408)

Registers the CSS relevant to the TTabControl.

It will register the CSS file specified by CssUrl. If that is not set, it will use the default CSS.

  • access: protected
void registerStyleSheet ()
render (line 493)
  • access: public
void render ( $writer)
  • $writer

Redefinition of:
TWebControl::render()
Renders the control.
renderContents (line 503)

Renders body contents of the tab control.

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

Redefinition of:
TWebControl::renderContents()
Renders the body content enclosed between the control tag.
setActiveTabCssClass (line 290)
  • access: public
void setActiveTabCssClass (string $value)
  • string $value: CSS class for the active tab.
setActiveView (line 169)
  • throws: TInvalidOperationException if the view is not in the view collection
  • access: public
void setActiveView (TTabView $view)
  • TTabView $view: the view to be activated
setActiveViewID (line 119)
  • access: public
void setActiveViewID (string $value)
  • string $value: The ID of the active tab view.
setActiveViewIndex (line 100)
  • throws: TInvalidDataValueException if the view index is invalid
  • access: public
void setActiveViewIndex (integer $value)
  • integer $value: the zero-based index of the current view in the view collection. -1 if no active view.
setAutoSwitch (line 188)
  • access: public
void setAutoSwitch (bool $value)
  • bool $value: whether to enable automatic tab switch on hover
setCssUrl (line 205)
  • access: public
void setCssUrl (string $value)
  • string $value: URL for the CSS file including all relevant CSS class definitions.
setTabCssClass (line 260)
  • access: public
void setTabCssClass (string $value)
  • string $value: CSS class for non-active tabs.
setViewCssClass (line 230)
  • access: public
void setViewCssClass (string $value)
  • string $value: CSS class for the currently displayed view div.

Inherited 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::getDecorator()
TWebControl::getDisplay()
TWebControl::getEnsureId()
TWebControl::getFont()
TWebControl::getForeColor()
TWebControl::getHasStyle()
TWebControl::getHeight()
TWebControl::getStyle()
TWebControl::getTabIndex()
TWebControl::getTagName()
TWebControl::getToolTip()
TWebControl::getWidth()
TWebControl::onPreRender()
TWebControl::render()
TWebControl::renderBeginTag()
TWebControl::renderContents()
TWebControl::renderEndTag()
TWebControl::setAccessKey()
TWebControl::setBackColor()
TWebControl::setBorderColor()
TWebControl::setBorderStyle()
TWebControl::setBorderWidth()
TWebControl::setCssClass()
TWebControl::setDisplay()
TWebControl::setEnsureId()
TWebControl::setForeColor()
TWebControl::setHeight()
TWebControl::setStyle()
TWebControl::setTabIndex()
TWebControl::setToolTip()
TWebControl::setWidth()

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::getIsSkinApplied()
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::__call()
TComponent::__get()
TComponent::__set()
TComponent::__sleep()
TComponent::__wakeup()
Class Constants

Documentation generated on Mon, 25 Jun 2012 14:39:25 +0200 by phpDocumentor 1.4.3