In an app I'm working on, I use Control.Tabs in a page fragment that's loaded dynamically. The page fragment can be loaded, then replaced with something else, then loaded again with updated data... but the same HTML IDs. (AFAIK it's not a violation of the "unique IDs" constraint, because the original IDs are gone by the time we do this.)
I have code in this fragment that looks up a tab object using Control.Tabs.findByTabId, and then sets the active tab. The problem is that the old tab object, from the first time the fragment was loaded, is still around... so I get a tab object that tries to hide and show the OLD tab elements, which doesn't do much good.
At first I thought Control.Tabs could detect when a new tab object overrides an old one, and removed the old one. OTOH I can imagine a use for multiple tab objects managing the same containers. Although not the same links.
A simpler approach would be to manually delete old tab objects. I think I could do it just by munging Control.Tabs.instances directly.
But my quick fix was just to make Control.Tabs.findByTabId comb through instances.reverse(false) instead of instances, so it finds the new object first.
I can't imagine this being a high priority to address; just thought I'd post here since I encountered it.
In an app I'm working on, I use Control.Tabs in a page fragment that's loaded dynamically. The page fragment can be loaded, then replaced with something else, then loaded again with updated data... but the same HTML IDs. (AFAIK it's not a violation of the "unique IDs" constraint, because the original IDs are gone by the time we do this.)
I have code in this fragment that looks up a tab object using Control.Tabs.findByTabId, and then sets the active tab. The problem is that the old tab object, from the first time the fragment was loaded, is still around... so I get a tab object that tries to hide and show the OLD tab elements, which doesn't do much good.
At first I thought Control.Tabs could detect when a new tab object overrides an old one, and removed the old one. OTOH I can imagine a use for multiple tab objects managing the same containers. Although not the same links.
A simpler approach would be to manually delete old tab objects. I think I could do it just by munging Control.Tabs.instances directly.
But my quick fix was just to make Control.Tabs.findByTabId comb through instances.reverse(false) instead of instances, so it finds the new object first.
I can't imagine this being a high priority to address; just thought I'd post here since I encountered it.
Posted December 5th, 2007 at 8:52pm by eostrom