i dev a Firefox extension and i try to add a tabpanel in a tabbox (xul).
The tabbox:
<tabbox id="tbDashboard" selectedIndex="0" >
<tabs><!-- list of tabs -->
<tab label="Overview"/> <!-- default tab -->
<tab label="test"/>
</tabs>
<tabpanels><!-- list of contents -->
<tabpanel ><!-- default tab's content -->
<box orient="horizontal" flex="1">
<description style="font-size: 24pt;">overview</description>
</box>
</tabpanel>
<tabpanel ><!-- test tab's content -->
<box orient="horizontal" flex="1">
<description style="font-size: 24pt;">test</description>
</box>
</tabpanel>
</tabpanel>
</tabpanels>
</tabbox>
I can add a new tab in JS with:
document.getElementById("tbDashboard")["tabs"].appendItem("popo");
The tab is appears but the tab page is empty, i tried to:
- use appendItem with a second parameter => don’t work
- document.getElementById(“tbDashboard”)[“tabpanels”].appendItem(…) => fail
Someone have an idea to create the tab page (a tabpanel) ??
thx
tabs.appendItem()is merely a convenient helper to create atabelement. It is essentially the same as:You can create and add a
tabpanelelement in the same way (here with a text box as only contents):For a tutorial on DOM manipulation see https://developer.mozilla.org/en/XUL_Tutorial/Modifying_a_XUL_Interface.