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.

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>

  • since: 3.1.1
  • version: $Id: TTabPanel.php 2197 2007-09-03 19:02:11Z xue $
  • author: Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>

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

TComponent
   |
   --TApplicationComponent
      |
      --TControl
         |
         --TWebControl
            |
            --TTabPanel
Method Summary
void activateView (TTabView $view)
void addParsedObject (mixed $object)
string getActiveViewID ()
integer getActiveViewIndex ()
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 renderContents (THtmlWriter $writer)
void setActiveTabCssClass (string $value)
void setActiveView (TTabView $view)
void setActiveViewID (string $value)
void setActiveViewIndex (integer $value)
void setCssUrl (string $value)
void setTabCssClass (string $value)
void setViewCssClass (string $value)
Methods
activateView (line 293)

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

Adds attributes to renderer.

  • access: protected
void addAttributesToRender (THtmlWriter $writer)

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

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

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 261)
  • return: CSS class for the active tab. Defaults to 'tab-active'.
  • access: public
string getActiveTabCssClass ()
getActiveTabStyle (line 277)
  • return: the style for the active tab div
  • access: public
TStyle getActiveTabStyle ()
getActiveView (line 127)

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
  • access: public
  • throws: TInvalidDataValueException if the active view ID or index set previously is invalid
TTabView getActiveView ()
getActiveViewID (line 107)

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

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 ()
getClientClassName (line 413)

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 421)
  • return: the options for JavaScript
  • access: protected
array getClientOptions ()
getCssClass (line 192)
  • return: CSS class for the whole tab control div. Defaults to 'tab-panel'.
  • access: public
string getCssClass ()

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

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 231)
  • return: CSS class for non-active tabs. Defaults to 'tab-normal'.
  • access: public
string getTabCssClass ()
getTabStyle (line 247)
  • return: the style for all the inactive tab div
  • access: public
TStyle getTabStyle ()
getTagName (line 64)
  • return: tag name for the control
  • access: protected
string getTagName ()

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

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

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:
TControl::onPreRender()
This method is invoked when the control enters 'OnPreRender' stage.
raisePostDataChangedEvent (line 340)

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

Registers the relevant JavaScript.

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

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 ()
renderContents (line 458)

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 269)
  • access: public
void setActiveTabCssClass (string $value)
  • string $value: CSS class for the active tab.
setActiveView (line 165)
  • access: public
  • throws: TInvalidOperationException if the view is not in the view collection
void setActiveView (TTabView $view)
  • TTabView $view: the view to be activated
setActiveViewID (line 115)
  • access: public
void setActiveViewID (string $value)
  • string $value: The ID of the active tab view.
setActiveViewIndex (line 96)
  • access: public
  • throws: TInvalidDataValueException if the view index is invalid
void setActiveViewIndex (integer $value)
  • integer $value: the zero-based index of the current view in the view collection. -1 if no active view.
setCssUrl (line 184)
  • access: public
void setCssUrl (string $value)
  • string $value: URL for the CSS file including all relevant CSS class definitions.
setTabCssClass (line 239)
  • access: public
void setTabCssClass (string $value)
  • string $value: CSS class for non-active tabs.
setViewCssClass (line 209)
  • 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::getDisplay()
TWebControl::getFont()
TWebControl::getForeColor()
TWebControl::getHasStyle()
TWebControl::getHeight()
TWebControl::getStyle()
TWebControl::getTabIndex()
TWebControl::getTagName()
TWebControl::getToolTip()
TWebControl::getWidth()
TWebControl::render()
TWebControl::renderBeginTag()
TWebControl::renderContents()
TWebControl::renderEndTag()
TWebControl::setAccessKey()
TWebControl::setBackColor()
TWebControl::setBorderColor()
TWebControl::setBorderStyle()
TWebControl::setBorderWidth()
TWebControl::setCssClass()
TWebControl::setDisplay()
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::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:29 -0400 by phpDocumentor 1.3.0RC4