Ajax JavaScript CSS HTML 5 DOM

Tabs and Tabbox

Your browser displays probably several web pages in windows accessible by tabs. We will describe step by step how to achieve such a tabbed interface in XUL language with tabbox .

Tabbox is a special box that contains a collection of pages accessed via tabs. This can be done by defining a list of tabs, followed by a list of panels that contain pages or widgets.

The comprehensive code looks like this:

<tabbox>
    <tabs>
        <tab label="" />
    </tabs>
    <tabpanels>
        <tabpanel>
              ... widgets...
         </tabpanel>
    </tabpanels>
</tabbox>

There are as many tab tags and tabpanel as tabs and pages.

The tags for defining tabbed pages

All these tags are used in the previous code of a tabbed structure:

Tabbox

Box to contain specific panels with tabs.

Tabs

List of tabs.

Tab

Definition of a tab.

Tabpanels

List of panels.

Tabpanel

Definition of a panel, container of other widgets that are contained within the page.

The tabbox container tells the runtime that panels are stacked and displayed one at a time. The remaining tags are specialized containers.

Demonstration

An example to achieve an interface made of pages accessible via tabs. The interface consists of two pages, so two tabs, each page will contain a textbox that allows you to enter text. All other widgets or sets of elements could form the content of pages too.

That is the simplified code:

<tabbox>
    <tabs>
        <tab label="Page 1" />
        <tab label="Page 2" />
    </tabs>
    <tabpanels>
        <tabpanel>
            <textbox value="First page"></textbox>
        </tabpanel>
        <tabpanel>
            <textbox value="Second page"></textbox>
        </tabpanel>
    </tabpanels>
</tabbox>
Forum

How put tabs in multi row?

Wed, 16 Jul 2008 11:48:28

tara

Hi, Is there a way to put tabs in two or more rows in one tabbox? Thanks
Sat, 19 Jul 2008 13:42:02

Administrator

Could you give a more precise description of what you want to do? A basic code example will be welcomed.
Fri, 15 Aug 2008 14:19:03

tara

<tabbox  flex="1">
    <tabs >
       <tab label="A"  />
       <tab label="B" />
       <tab label="C"  />
       <tab label="D" />
    </tabs>
    <tabpanels flex="1" >
       <label value="Tab A" />    
       <label value="Tab  B" />        
       <label value="Tab C" />    
       <label value="Tab  D" />
    </tabpanels>
  </tabbox>
I want to put tab C below tab A, and tab D below tab B. Is it possible?
Tue, 19 Aug 2008 13:11:14

Administrator

Yes, it is clear now ;) Inside a tabpanel, you can put any widget, why not another tabbox?
Licence: © 2008-2013 Xul.fr