Package org.zkoss.zul

Class Tabbox

All Implemented Interfaces:
Serializable, Cloneable, Component, Scope, ComponentCtrl

public class Tabbox extends XulElement
A tabbox.

Event:

  1. org.zkoss.zk.ui.event.SelectEvent is sent when user changes the tab.

Mold:

default
The default tabbox.
accordion
The accordion tabbox.

Toolbar only works in the horizontal default mold and the isTabscroll() to be true. (since 3.6.3)

Default getZclass(): z-tabbox. (since 3.5.0)

Besides creating Tab and Tabpanel programmatically, you could assign a data model (a ListModel to a Tabbox via setModel(ListModel) and then the tabbox will retrieve data via ListModel.getElementAt(int) when necessary. (since 7.0.0) [ZK EE]

Besides assign a list model, you could assign a renderer (a TabboxRenderer instance) to a Tabbox, such that the Tabbox will use this renderer to render the data returned by ListModel.getElementAt(int). If not assigned, the default renderer, which assumes a label per Tab and Tabpanel, is used. In other words, the default renderer adds a label to a Tab and Tabpanel by calling toString against the object returned by ListModel.getElementAt(int) (since 7.0.0) [ZK EE]

To retrieve what are selected in Tabbox with a Selectable ListModel, you shall use Selectable.getSelection() to get what is currently selected object in ListModel rather than using getSelectedTab(). That is, you shall operate on the data of the ListModel rather than on the Tab of the Tabbox if you use the Selectable ListModel. (since 7.0.0) [ZK EE]


 Set selection = ((Selectable)getModel()).getSelection();
 
Author:
tomyeh
See Also: