PARENT_TABSET (Toplevel TabSet)
---------->MANAGE_TAB (1st tab of PARENT_TABSET)
--------------->MANAGE_TABSET (TabSet that is the only child control of MANAGE_TAB)
--------------------->12 tabs that belong to MANAGE_TABSET
---------->VIEW_TAB (2nd tab of PARENT_TABSET)
--------------->VIEW_TABSET (Tabset that is the only child control of VIEW_TABSET)
--------------------->3 tabs that belong to VIEW_TABSET
---------->MISC_TAB (3rd tab of PARENT_TABSET)
--------------->MISC_TABSET (Tabset that is the only child of MISC_TABSET)
--------------------->2 tabs that belong to MISC_TABSET
I have a field called JUMP_TO_TAB that is a dropdown that I have populated with the tab header text of all the individual tabs for each tab set (17 items in the dropdown total which is 12+3+2). I want to be able to select an item from the dropdown and select that tab so it has the focus.
This is my code so far.
Code: Select all
for each (var currentParentTabset in parent_tabset) {
var child_tabset=controls.getControl(currentParentTabset.elementName).childControls;
for each (var currentChildTabset in child_tabset) {
var child_child_tabset=controls.getControl(currentChildTabset.elementName).childControls;
for each (var currentChildChildTabset in child_child_tabset) {
if (currentChildChildTabset.elementName == fields.JUMP_TO_TAB.value) {
controls.getControl(currentChildTabset.elementName).selected=currentChildChildTabset.elementName;
}
}
}
}
I cannot figure out how to make this work correctly. Do I need to set the selected on PARENT_TABSET then one of its 3 children tabsets first ?
I did try setting the selected tab of PARENT_TABSET first but this causes a weird problem where it is like I specified a non-existing tab to set the focus on because it is as if no tab is selected.