|
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
-
TApplicationComponent
-
TControl
implements
IRenderable,
IBindable
-
TWebControl
implements
IStyleable
-
TTabPanel
implements
IPostBackDataHandler
Methods summary
protected
string
|
#
getTagName( )
Returns
string tag name for the control
Overrides
|
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
|
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
|
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
|
public
|
|
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
|
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
|
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
|
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
|
protected
|
#
addAttributesToRender( THtmlWriter $writer )
Adds attributes to renderer.
Adds attributes to renderer.
Parameters
Overrides
|
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
|
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
Overrides
|
public
TTabViewCollection
|
|
public
|
#
render( THtmlWriter $writer )
Renders the control. This method overrides the parent implementation by
replacing it with the following sequence:
Renders the control. This method overrides the parent implementation by
replacing it with the following sequence:
Parameters
- $writer
THtmlWriter
the writer used for the rendering purpose
Overrides
|
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
|
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 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
|
|