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 TTabPanel

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 setAutoSwitch 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:

  • setActiveViewIndex ActiveViewIndex - the zero-based integer index of the view in the view collection.
  • setActiveViewID ActiveViewID - the text ID of the visible view.
  • setActiveView ActiveView - the visible view instance.

If both setActiveViewIndex ActiveViewIndex and setActiveViewID 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 setCssUrl CssUrl property. The following properties specify the CSS classes used for elements in a TTabPanel:

  • setCssClass CssClass - the CSS class name for the outer-most div element (defaults to 'tab-panel');
  • setTabCssClass TabCssClass - the CSS class name for nonactive tab div elements (defaults to 'tab-normal');
  • setActiveTabCssClass ActiveTabCssClass - the CSS class name for the active tab div element (defaults to 'tab-active');
  • setViewCssClass ViewCssClass - the CSS class for the div element enclosing view content (defaults to 'tab-view');

To use TTabPanel, write a template like following:

<com:TTabPanel>
  <com:TTabView Caption="View 1">
    content for view 1
  </com:TTabView>
  <com:TTabView Caption="View 2">
    content for view 2
  </com:TTabView>
  <com:TTabView Caption="View 3">
    content for view 3
  </com:TTabView>
</com:TTabPanel>
TComponent
Extended by TApplicationComponent
Extended by TControl implements IRenderable, IBindable
Extended by TWebControl implements IStyleable
Extended by TTabPanel implements IPostBackDataHandler
Package: System\Web\UI\WebControls
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
Since: 3.1.1
Located at Web/UI/WebControls/TTabPanel.php
Methods summary
protected string
# getTagName( )

Returns

string
tag name for the control

Overrides

TWebControl::getTagName()
public
# addParsedObject( mixed $object )

Adds object parsed from template to the control. This method adds only TTabView objects into the getViews Views collection. All other objects are ignored.

Adds object parsed from template to the control. This method adds only TTabView objects into the getViews Views collection. All other objects are ignored.

Parameters

$object
mixed
object parsed from template

Overrides

TControl::addParsedObject()
public integer
# getActiveViewIndex( )

Returns the index of the active tab view. Note, this property may not return the correct index. To ensure the correctness, call TTabPanel::getActiveView() first.

Returns the index of the active tab view. Note, this property may not return the correct index. To ensure the correctness, call TTabPanel::getActiveView() first.

Returns

integer
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).
public
# setActiveViewIndex( integer $value )

Parameters

$value
integer
the zero-based index of the current view in the view collection. -1 if no active view.

Throws

TInvalidDataValueException
if the view index is invalid
public string
# getActiveViewID( )

Returns the ID of the active tab view. Note, this property may not return the correct ID. To ensure the correctness, call TTabPanel::getActiveView() first.

Returns the ID of the active tab view. Note, this property may not return the correct ID. To ensure the correctness, call TTabPanel::getActiveView() first.

Returns

string
The ID of the active tab view. Defaults to '', meaning not set.
public
# setActiveViewID( string $value )

Parameters

$value
string
The ID of the active tab view.
public TTabView
# getActiveView( )

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.

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.

Returns

TTabView
the currently active view, null if no active view

Throws

TInvalidDataValueException
if the active view ID or index set previously is invalid
public
# setActiveView( TTabView $view )

Parameters

$view
TTabView
the view to be activated

Throws

TInvalidOperationException
if the view is not in the view collection
public boolean
# getAutoSwitch( )

Returns

boolean
status of automatic tab switch on hover
public
# setAutoSwitch( boolean $value )

Parameters

$value
boolean
whether to enable automatic tab switch on hover
public string
# getCssUrl( )

Returns

string
URL for the CSS file including all relevant CSS class definitions. Defaults to ''.
public
# setCssUrl( string $value )

Parameters

$value
string
URL for the CSS file including all relevant CSS class definitions.
public string
# getCssClass( )

Returns

string
CSS class for the whole tab control div. Defaults to 'tab-panel'.

Overrides

TWebControl::getCssClass()
public string
# getViewCssClass( )

Returns

string
CSS class for the currently displayed view div. Defaults to 'tab-view'.
public
# setViewCssClass( string $value )

Parameters

$value
string
CSS class for the currently displayed view div.
public TStyle
# getViewStyle( )

Returns

TStyle
the style for all the view div
public string
# getTabCssClass( )

Returns

string
CSS class for non-active tabs. Defaults to 'tab-normal'.
public
# setTabCssClass( string $value )

Parameters

$value
string
CSS class for non-active tabs.
public TStyle
# getTabStyle( )

Returns

TStyle
the style for all the inactive tab div
public string
# getActiveTabCssClass( )

Returns

string
CSS class for the active tab. Defaults to 'tab-active'.
public
# setActiveTabCssClass( string $value )

Parameters

$value
string
CSS class for the active tab.
public TStyle
# getActiveTabStyle( )

Returns

TStyle
the style for the active tab div
protected
# activateView( TTabView $view )

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

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

Parameters

$view
TTabView
the view to be activated. If null, all views will be deactivated.
public boolean
# loadPostData( string $key, array $values )

Loads user input data. This method is primarly used by framework developers.

Loads user input data. This method is primarly used by framework developers.

Parameters

$key
string
the key that can be used to retrieve data from the input data collection
$values
array
the input data collection

Returns

boolean
whether the data of the control has been changed

Implementation of

IPostBackDataHandler::loadPostData()
public
# raisePostDataChangedEvent( )

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

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

Implementation of

IPostBackDataHandler::raisePostDataChangedEvent()
public boolean
# getDataChanged( )

Returns a value indicating whether postback has caused the control data change. This method is required by the IPostBackDataHandler interface.

Returns a value indicating whether postback has caused the control data change. This method is required by the IPostBackDataHandler interface.

Returns

boolean
whether postback has caused the control data change. False if the page is not in postback mode.

Implementation of

IPostBackDataHandler::getDataChanged()
protected
# addAttributesToRender( THtmlWriter $writer )

Adds attributes to renderer.

Adds attributes to renderer.

Parameters

$writer
THtmlWriter
the renderer

Overrides

TWebControl::addAttributesToRender()
public
# onPreRender( mixed $param )

Registers CSS and JS. This method is invoked right before the control rendering, if the control is visible.

Registers CSS and JS. This method is invoked right before the control rendering, if the control is visible.

Parameters

$param
mixed
event parameter

Overrides

TWebControl::onPreRender()
protected
# registerStyleSheet( )

Registers the CSS relevant to the TTabControl. It will register the CSS file specified by getCssUrl CssUrl. If that is not set, it will use the default CSS.

Registers the CSS relevant to the TTabControl. It will register the CSS file specified by getCssUrl CssUrl. If that is not set, it will use the default CSS.

protected
# registerClientScript( )

Registers the relevant JavaScript.

Registers the relevant JavaScript.

protected string
# getClientClassName( )

Gets the name of the javascript class responsible for performing postback for this control. This method overrides the parent implementation.

Gets the name of the javascript class responsible for performing postback for this control. This method overrides the parent implementation.

Returns

string
the javascript class name
protected array
# getClientOptions( )

Returns

array
the options for JavaScript
protected TTabViewCollection
# createControlCollection( )

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

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

Returns

TTabViewCollection
control collection

Overrides

TControl::createControlCollection()
public TTabViewCollection
# getViews( )

Returns

TTabViewCollection
list of TTabView controls
public
# render( THtmlWriter $writer )

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

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

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

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

Parameters

$writer
THtmlWriter
the writer used for the rendering purpose

Overrides

TWebControl::render()
public
# renderContents( THtmlWriter $writer )

Renders body contents of the tab control.

Renders body contents of the tab control.

Parameters

$writer
THtmlWriter
the writer used for the rendering purpose.

Overrides

TWebControl::renderContents()
Methods inherited from TWebControl
clearStyle(), copyBaseAttributes(), createStyle(), getAccessKey(), getBackColor(), getBorderColor(), getBorderStyle(), getBorderWidth(), getDecorator(), getDisplay(), getEnsureId(), getFont(), getForeColor(), getHasStyle(), getHeight(), getStyle(), getTabIndex(), getToolTip(), getWidth(), renderBeginTag(), renderEndTag(), setAccessKey(), setBackColor(), setBorderColor(), setBorderStyle(), setBorderWidth(), setCssClass(), setDisplay(), setEnsureId(), setForeColor(), setHeight(), setStyle(), setTabIndex(), setToolTip(), setWidth()
Methods inherited from TControl
__construct(), __get(), addToPostDataLoader(), addedControl(), applyStyleSheetSkin(), autoBindProperty(), autoDataBindProperties(), bindProperty(), broadcastEvent(), bubbleEvent(), clearChildState(), clearControlState(), clearNamingContainer(), clearViewState(), convertUniqueIdToClientId(), createChildControls(), 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 inherited from TWebControl
$_decorator
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