Print Friendly

# Class YAHOO.ext.TabPanelItem

Package: | YAHOO.ext
Class: | TabPanelItem
Extends: | Observable
Defined In: | TabPanel.js

## Public Properties

Property | Defined By
--- | ---
| bodyEl : YAHOO.ext.Element | TabPanelItem
The body element for this TabPanelItem
| closeText : String | TabPanelItem
The text displayed in the tooltip for the close icon.
| id : String | TabPanelItem
The id for this TabPanelItem
| tabPanel : YAHOO.ext.TabPanel | TabPanelItem
The TabPanel this TabPanelItem belongs to

## Public Methods

Method | Defined By
--- | ---
| activate() : void | TabPanelItem
Activate this TabPanelItem - this does deactivate the currently active TabPanelItem.
| addListener(`String eventName`, `Function handler`, [`Object scope`], [`boolean override`]) : void | Observable
Appends an event handler to this component
| bufferedListener(`String eventName`, `Function handler`, [`Object scope`], [`Number millis`]) : Function | Observable
Appends an event handler to this component that is buffered. If the event is triggered more than once in the specifie...
| delayedListener(`String eventName`, `Function handler`, [`Object scope`], [`Number delay`]) : Function | Observable
Appends an event handler to this component that is delayed the specified number of milliseconds. This is useful for e...
| disable() : void | TabPanelItem
Disable this TabPanelItem - this call is ignore if this is the active TabPanelItem.
| enable() : void | TabPanelItem
Enable this TabPanelItem if it was previously disabled.
| fireEvent(`String eventName`, `Object... args`) : Boolean | Observable
Fires the specified event with the passed parameters (minus the event name).
| getText() : String | TabPanelItem
Returns the text for this tab
| getUpdateManager() : YAHOO.ext.UpdateManager | TabPanelItem
Get the YAHOO.ext.UpdateManager for the body of this TabPanelItem. Enables you to perform Ajax updates.
| hide() : void | TabPanelItem
Hide this TabPanelItem - if you don't activate another TabPanelItem this could look odd.
| isActive() : Boolean | TabPanelItem
Returns true if this tab is the active tab
| isHidden() : Boolean | TabPanelItem
Returns true if this tab is "hidden"
| on(`String eventName`, `Function handler`, [`Object scope`], [`boolean override`]) : void | Observable
Appends an event handler to this element (shorthand for addListener)
| purgeListeners() : void | Observable
Removes all listeners for this object
| refresh() : void | TabPanelItem
Force a content refresh from the URL specified in the setUrl() method. Will fail silently if the setUrl method has no...
| removeListener(`String eventName`, `Function handler`, [`Object scope`]) : void | Observable
Removes a listener
| setContent(`String content`, `Boolean loadScripts`) : void | TabPanelItem
Set the content for this TabPanelItem.
| setText(`String text`) : void | TabPanelItem
Sets the text for the tab (Note: this also sets the tooltip)
| setTooltip(`String tooltip`) : void | TabPanelItem
Set the tooltip (title attribute) for the tab
| setUrl(`String/Function url`, [`String/Object params`], [`Boolean loadOnce`]) : YAHOO.ext.UpdateManager | TabPanelItem
Set a URL to be used to load the content for this TabPanelItem.
| show() : void | TabPanelItem
Show this TabPanelItem - this does not deactivate the currently active TabPanelItem.

## Public Events

Event | Defined By
--- | ---
| activate : (`YAHOO.ext.TabPanel tabPanel`, `YAHOO.ext.TabPanelItem this`) | TabPanelItem
Fires when this tab becomes the active tab
| beforeclose : (`YAHOO.ext.TabPanelItem this`, `Object e`) | TabPanelItem
Fires before this tab is closed. To cancal the close, set cancel to true on e. (e.cancel = true)
| close : (`YAHOO.ext.TabPanelItem this`) | TabPanelItem
Fires when this tab is closed
| deactivate : (`YAHOO.ext.TabPanel tabPanel`, `YAHOO.ext.TabPanelItem this`) | TabPanelItem
Fires when this tab is no longer the active tab

## Property Details

### bodyEl

`public YAHOO.ext.Element bodyEl`
The body element for this TabPanelItem
This property is defined by TabPanelItem.

### closeText

`public String closeText`
The text displayed in the tooltip for the close icon.
This property is defined by TabPanelItem.

### id

`public String id`
The id for this TabPanelItem
This property is defined by TabPanelItem.

### tabPanel

`public YAHOO.ext.TabPanel tabPanel`
The TabPanel this TabPanelItem belongs to
This property is defined by TabPanelItem.

## Method Details

### activate

`public function activate()`
Activate this TabPanelItem - this does deactivate the currently active TabPanelItem.
Parameters:

- None.

Returns:

- `void`

This method is defined by TabPanelItem.

### addListener

`public function addListener(`String eventName`, `Function handler`, [`Object scope`], [`boolean override`])`
Appends an event handler to this component
Parameters:

- `eventName` : String
  The type of event to listen for
- `handler` : Function
  The method the event invokes
- `scope` : Object
  (optional) The scope (this object) for the handler
- `override` : boolean
  (optional) If true, scope becomes the scope

Returns:

- `void`

This method is defined by Observable.

### bufferedListener

`public function bufferedListener(`String eventName`, `Function handler`, [`Object scope`], [`Number millis`])`
Appends an event handler to this component that is buffered. If the event is triggered more than once in the specified time-frame, only the last one actually fires.
Parameters:

- `eventName` : String
  The type of event to listen for
- `handler` : Function
  The method the event invokes
- `scope` : Object
  (optional) The scope (this object) for the handler
- `millis` : Number
  (optional) The number of milliseconds to buffer (defaults to 250)

Returns:

- `Function`
  The wrapped function that was created (can be used to remove the listener)

This method is defined by Observable.

### delayedListener

`public function delayedListener(`String eventName`, `Function handler`, [`Object scope`], [`Number delay`])`
Appends an event handler to this component that is delayed the specified number of milliseconds. This is useful for events that modify the DOM and need to wait for the browser to catch up.
Parameters:

- `eventName` : String
  The type of event to listen for
- `handler` : Function
  The method the event invokes
- `scope` : Object
  (optional) The scope (this object) for the handler
- `delay` : Number
  (optional) The number of milliseconds to delay (defaults to 1 millisecond)

Returns:

- `Function`
  The wrapped function that was created (can be used to remove the listener)

This method is defined by Observable.

### disable

`public function disable()`
Disable this TabPanelItem - this call is ignore if this is the active TabPanelItem.
Parameters:

- None.

Returns:

- `void`

This method is defined by TabPanelItem.

### enable

`public function enable()`
Enable this TabPanelItem if it was previously disabled.
Parameters:

- None.

Returns:

- `void`

This method is defined by TabPanelItem.

### fireEvent

`public function fireEvent(`String eventName`, `Object... args`)`
Fires the specified event with the passed parameters (minus the event name).
Parameters:

- `eventName` : String
- `args` : Object...
  Variable number of parameters are passed to handlers

Returns:

- `Boolean`
  returns false if any of the handlers return false otherwise it returns true

This method is defined by Observable.

### getText

`public function getText()`
Returns the text for this tab
Parameters:

- None.

Returns:

- `String`

This method is defined by TabPanelItem.

### getUpdateManager

`public function getUpdateManager()`
Get the YAHOO.ext.UpdateManager for the body of this TabPanelItem. Enables you to perform Ajax updates.
Parameters:

- None.

Returns:

- `YAHOO.ext.UpdateManager`
  The UpdateManager

This method is defined by TabPanelItem.

### hide

`public function hide()`
Hide this TabPanelItem - if you don't activate another TabPanelItem this could look odd.
Parameters:

- None.

Returns:

- `void`

This method is defined by TabPanelItem.

### isActive

`public function isActive()`
Returns true if this tab is the active tab
Parameters:

- None.

Returns:

- `Boolean`

This method is defined by TabPanelItem.

### isHidden

`public function isHidden()`
Returns true if this tab is "hidden"
Parameters:

- None.

Returns:

- `Boolean`

This method is defined by TabPanelItem.

### on

`public function on(`String eventName`, `Function handler`, [`Object scope`], [`boolean override`])`
Appends an event handler to this element (shorthand for addListener)
Parameters:

- `eventName` : String
  The type of event to listen for
- `handler` : Function
  The method the event invokes
- `scope` : Object
  (optional) The scope (this object) for the handler
- `override` : boolean
  (optional) If true, scope becomes the scope

Returns:

- `void`

This method is defined by Observable.

### purgeListeners

`public function purgeListeners()`
Removes all listeners for this object
Parameters:

- None.

Returns:

- `void`

This method is defined by Observable.

### refresh

`public function refresh()`
Force a content refresh from the URL specified in the setUrl() method. Will fail silently if the setUrl method has not been called. This does not activate the panel, just updates its content.
Parameters:

- None.

Returns:

- `void`

This method is defined by TabPanelItem.

### removeListener

`public function removeListener(`String eventName`, `Function handler`, [`Object scope`])`
Removes a listener
Parameters:

- `eventName` : String
  The type of event to listen for
- `handler` : Function
  The handler to remove
- `scope` : Object
  (optional) The scope (this object) for the handler

Returns:

- `void`

This method is defined by Observable.

### setContent

`public function setContent(`String content`, `Boolean loadScripts`)`
Set the content for this TabPanelItem.
Parameters:

- `content` : String
  The content
- `loadScripts` : Boolean
  true to look for and load scripts

Returns:

- `void`

This method is defined by TabPanelItem.

### setText

`public function setText(`String text`)`
Sets the text for the tab (Note: this also sets the tooltip)
Parameters:

- `text` : String

Returns:

- `void`

This method is defined by TabPanelItem.

### setTooltip

`public function setTooltip(`String tooltip`)`
Set the tooltip (title attribute) for the tab
Parameters:

- `tooltip` : String

Returns:

- `void`

This method is defined by TabPanelItem.

### setUrl

`public function setUrl(`String/Function url`, [`String/Object params`], [`Boolean loadOnce`])`
Set a URL to be used to load the content for this TabPanelItem.
Parameters:

- `url` : String/Function
  The url to load the content from or a function to call to get the url
- `params` : String/Object
  (optional) The string params for the update call or an object of the params. See YAHOO.ext.UpdateManager.update for more details. (Defaults to null)
- `loadOnce` : Boolean
  (optional) Whether to only load the content once. If this is false it makes the Ajax call every time this TabPanelItem is activated. (Defaults to false)

Returns:

- `YAHOO.ext.UpdateManager`
  The UpdateManager

This method is defined by TabPanelItem.

### show

`public function show()`
Show this TabPanelItem - this does not deactivate the currently active TabPanelItem.
Parameters:

- None.

Returns:

- `void`

This method is defined by TabPanelItem.

## Event Details

### activate

`public event activate`
Fires when this tab becomes the active tab
Subscribers will be called with the following parameters:

- `tabPanel` : YAHOO.ext.TabPanel
- `this` : YAHOO.ext.TabPanelItem

This event is defined by TabPanelItem.

### beforeclose

`public event beforeclose`
Fires before this tab is closed. To cancal the close, set cancel to true on e. (e.cancel = true)
Subscribers will be called with the following parameters:

- `this` : YAHOO.ext.TabPanelItem
- `e` : Object
  Set cancel to true on this object to cancel the close.

This event is defined by TabPanelItem.

### close

`public event close`
Fires when this tab is closed
Subscribers will be called with the following parameters:

- `this` : YAHOO.ext.TabPanelItem

This event is defined by TabPanelItem.

### deactivate

`public event deactivate`
Fires when this tab is no longer the active tab
Subscribers will be called with the following parameters:

- `tabPanel` : YAHOO.ext.TabPanel
- `this` : YAHOO.ext.TabPanelItem

This event is defined by TabPanelItem.

yui-ext - Copyright © 2006 Jack Slocum. | Yahoo! UI - Copyright © 2006 Yahoo! Inc.
All rights reserved.