# Yahoo! UI Library

### tabview 2.6.0

Yahoo! UI Library > tabview > YAHOO.widget.Tab

Show Private Show Protected Show Deprecated

## Class YAHOO.widget.Tab - extends YAHOO.util.Element

A representation of a Tab's label and content.

### Constructor

YAHOO.widget.Tab `( element , properties )`

Parameters:
  `element <HTMLElement | String>` (optional) The html element that represents the TabView. An element will be created if none provided.
  `properties <Object>` A key map of initial properties

### Properties

#### ACTIVE_CLASSNAME `- String`

The class name applied to active tabs.
Default Value: "selected"

#### ACTIVE_TITLE `- String`

The title applied to active tabs.
Default Value: "active"

#### dataConnection `- Object`

Provides a reference to the connection request object when data is loaded dynamically.

#### DISABLED_CLASSNAME `- String`

The class name applied to disabled tabs.
Default Value: "disabled"

#### LABEL_INNER_TAGNAME `- String`

The default tag name for a Tab's inner element.
Default Value: "em"

#### loadHandler `- object`

Object containing success and failure callbacks for loading data.

#### LOADING_CLASSNAME `- String`

The class name applied to dynamic tabs while loading.
Default Value: "disabled"

#### Properties inherited from YAHOO.util.Element:

`DOM_EVENTS`

#### Properties inherited from YAHOO.util.AttributeProvider:

`_configs`

#### Properties inherited from YAHOO.util.EventProvider:

`__yui_events, __yui_subscribers`

### Methods

#### initAttributes

`void initAttributes ( attr )`
setAttributeConfigs TabView specific properties.

Parameters:
  `attr <Object>` Hash of initial attributes

Returns: `void`

#### toString

`toString ( )`
Provides a readable name for the tab.

#### Methods inherited from YAHOO.util.Element:

`_registerHTMLAttr, addClass, addListener, appendChild, appendTo, fireQueue, getElementsByClassName, getElementsByTagName, getStyle, hasChildNodes, hasClass, initAttributes, insertBefore, on, removeChild, removeClass, removeListener, replaceChild, replaceClass, setStyle, subscribe`

#### Methods inherited from YAHOO.util.AttributeProvider:

`configureAttribute, fireBeforeChangeEvent, fireChangeEvent, get, getAttributeConfig, getAttributeKeys, refresh, register, resetAttributeConfig, resetValue, set, setAttributeConfig, setAttributes`

#### Methods inherited from YAHOO.util.EventProvider:

`createEvent, fireEvent, hasEvent, subscribe, unsubscribe, unsubscribeAll`

### Events

#### activationEventChange

`activationEventChange ( event )`
Fires when the value for the configuration attribute 'activationEvent' changes.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### activeChange

`activeChange ( event )`
Fires when the value for the configuration attribute 'active' changes.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### beforeActivationEventChange

`beforeActivationEventChange ( event )`
Fires before the value for the configuration attribute 'activationEvent' changes. Return false to cancel the attribute change.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### beforeActiveChange

`beforeActiveChange ( event )`
Fires before the value for the configuration attribute 'active' changes. Return false to cancel the attribute change.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### beforeCacheDataChange

`beforeCacheDataChange ( event )`
Fires before the value for the configuration attribute 'cacheData' changes. Return false to cancel the attribute change.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### beforeContentChange

`beforeContentChange ( event )`
Fires before the value for the configuration attribute 'content' changes. Return false to cancel the attribute change.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### beforeContentElChange

`beforeContentElChange ( event )`
Fires before the value for the configuration attribute 'contentEl' changes. Return false to cancel the attribute change.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### beforeContentVisibleChange

`beforeContentVisibleChange ( event )`
Fires before the value for the configuration attribute 'contentVisible' changes. Return false to cancel the attribute change.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### beforeDataLoadedChange

`beforeDataLoadedChange ( event )`
Fires before the value for the configuration attribute 'dataLoaded' changes. Return false to cancel the attribute change.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### beforeDataSrcChange

`beforeDataSrcChange ( event )`
Fires before the value for the configuration attribute 'dataSrc' changes. Return false to cancel the attribute change.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### beforeDataTimeoutChange

`beforeDataTimeoutChange ( event )`
Fires before the value for the configuration attribute 'dataTimeout' changes. Return false to cancel the attribute change.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### beforeDisabledChange

`beforeDisabledChange ( event )`
Fires before the value for the configuration attribute 'disabled' changes. Return false to cancel the attribute change.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### beforeHrefChange

`beforeHrefChange ( event )`
Fires before the value for the configuration attribute 'href' changes. Return false to cancel the attribute change.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### beforeLabelChange

`beforeLabelChange ( event )`
Fires before the value for the configuration attribute 'label' changes. Return false to cancel the attribute change.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### beforeLabelElChange

`beforeLabelElChange ( event )`
Fires before the value for the configuration attribute 'labelEl' changes. Return false to cancel the attribute change.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### beforeLoadMethodChange

`beforeLoadMethodChange ( event )`
Fires before the value for the configuration attribute 'loadMethod' changes. Return false to cancel the attribute change.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### cacheDataChange

`cacheDataChange ( event )`
Fires when the value for the configuration attribute 'cacheData' changes.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### contentChange

`contentChange ( event )`
Fires when the value for the configuration attribute 'content' changes.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### contentElChange

`contentElChange ( event )`
Fires when the value for the configuration attribute 'contentEl' changes.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### contentVisibleChange

`contentVisibleChange ( event )`
Fires when the value for the configuration attribute 'contentVisible' changes.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### dataLoadedChange

`dataLoadedChange ( event )`
Fires when the value for the configuration attribute 'dataLoaded' changes.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### dataSrcChange

`dataSrcChange ( event )`
Fires when the value for the configuration attribute 'dataSrc' changes.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### dataTimeoutChange

`dataTimeoutChange ( event )`
Fires when the value for the configuration attribute 'dataTimeout' changes.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### disabledChange

`disabledChange ( event )`
Fires when the value for the configuration attribute 'disabled' changes.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### hrefChange

`hrefChange ( event )`
Fires when the value for the configuration attribute 'href' changes.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### labelChange

`labelChange ( event )`
Fires when the value for the configuration attribute 'label' changes.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### labelElChange

`labelElChange ( event )`
Fires when the value for the configuration attribute 'labelEl' changes.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### loadMethodChange

`loadMethodChange ( event )`
Fires when the value for the configuration attribute 'loadMethod' changes.

Parameters:
  `event <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### Events inherited from YAHOO.util.Element:

`appendTo, available, beforeAppendTo, beforeElementChange, contentReady, elementChange,`

### Configuration Attributes

#### activationEvent `- String`

The event that triggers the tab's activation.

#### active `- Boolean`

Whether or not the tab is currently active. If a dataSrc is set for the tab, the content will be loaded from the given source.

#### cacheData `- Boolean`

Whether or not content should be reloaded for every view.
Default Value: false

#### content `- String`

The tab's content.

#### contentEl `- HTMLElement`

The HTMLElement that contains the tab's content.

#### contentVisible `- Boolean`

The Whether or not the tab's content is visible.
Default Value: false

#### dataLoaded `- Boolean`

Whether or not any data has been loaded from the server.

#### dataSrc `- String`

The tab's data source, used for loading content dynamically.

#### dataTimeout `- Number`

Number if milliseconds before aborting and calling failure handler.
Default Value: null

#### disabled `- Boolean`

Whether or not the tab is disabled.

#### href `- String`

The href of the tab's anchor element.
Default Value: '#'

#### label `- String`

The tab's label text (or innerHTML).

#### labelEl `- HTMLElement`

The element that contains the tab's label.

#### loadMethod `- String`

The method to use for the data request.
Default Value: "GET"

#### Configuration attributes inherited from YAHOO.util.Element:

`element,`

Copyright © 2008 Yahoo! Inc. All rights reserved.