Closed Bug 256024 Opened 20 years ago Closed 18 years ago

unable to persist the selected tab in TABBOX

Categories

(Core :: XUL, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 370742

People

(Reporter: cstehlin.ml, Assigned: jag+mozilla)

References

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 Currently, it's impossible to use the "persist" attribute on a tabbox to make the selected tab persist. Neither <tabpanels persist="selectedIndex" ...>, nor <tab persist="selected"> does the trick. This may be related to bug#245224 Reproducible: Always Steps to Reproduce: Actual Results: Attribute is correctly saved in the localstore.rdf, but when reopening the window containing the tabbox, the saved value is not used and the selected tab is always the first one (index=0). Expected Results: When reopening the window displaying the tabbox, the selected tab in the tabbox is the tab that was selected the last time. workaround : XUL : <window id="main-window" persist="tabSelectedIndex" onload="onWinLoad(event)" onunload="onWinUnload(event)" ... > JS : function onWinUnload(evt) { document.getElementById('main-window').setAttribute('tabSelectedIndex', document.getElementById('myTabBox').selectedIndex ) ; } function onWinLoad(evt) { document.getElementById('myTabBox').selectedIndex = document.getElementById('main-window').getAttribute('tabSelectedIndex') ; }
Probably bug 245224 and this bug are just symptoms of the same problem. Adding a dependency for now. Confirming with a current Linux build.
Status: UNCONFIRMED → NEW
Depends on: 245224
Ever confirmed: true
OS: Windows 2000 → All
(In reply to comment #0) This workaround maybe a little bit easier to use: function persistTabboxSelectedIndexHack(tabboxId) { // hack hack hack // See https://bugzilla.mozilla.org/attachment.cgi?id=192394 const tabbox = document.getElementById(tabboxId); tabbox.setAttribute("selectedIndex", tabbox.selectedIndex); } <tabbox id="test-tabbox" persist="selectedIndex"> <tabs onselect="persistTabboxSelectedIndexHack('test-tabbox')"> ....
Depends on: 370742
Fix by bug 370742
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Resolution: FIXED → DUPLICATE
You need to log in before you can comment on or make changes to this bug.