Referencing nested tab sheet

Hello,

How can I reference a tab sheet tab nested within another tab sheet tab that was created dynamically?

I have one tab sheet with location tabs, and within those tabs, another tabsheet with tabs with a JavaScriptComponent.

image

image

TabSheet.Tab plazaTab = plazaBox.getSelectedTab();

I can get the first tab like this, but how can I get a reference to the JavaScriptComponent within the nested tab so i can call functions?

Hello,

take a look at the following methods of TabSheet:

  • getTabComponent()
  • getComponent() or getComponentNN()

First method returns the component that is content of the tab.

TabSheet.Tab selectedTab = tabSheet.getSelectedTab();
tabSheet.getTabComponent(selectedTab.getName());

Last methods return the component by id:

JavaScriptComponent jsComponent = (JavaScriptComponent) tabSheet.getComponentNN("myJsComponentId");

this worked, thanks