I want to add a tab to a certain tab bar from inside the content area. The content area is dynamic, and as such, is located in a different class file. The only way I know of to get the current state of the tab bar (not create a new tab bar object) is to create a static method and variable to access the object. However I'm having problems doing any modification to the tab bar after I get it. I can call functions inside it without much trouble, such as retrieving strings, but I can't add a tab, which is what I need to do. Here's the general gist:
in one class named XYZ:
private static MyPersonalTabPanel mypersonalTabPanel;
public XYZ {
myperosonalTabPanel = this;
}
in my other file, on the click of a button, I'm triggering this:
MyPersonalTabPanel.getAppInstance().getXYZTabPanel().add(mywidget, "My Widget");
I can use my function "getXYZTabPanel()" with no errors, but when I try to "add" it will simply crash with a white screen, no relevant errors. Any help? I've seen projects add tabs before, but can't find any doing it through a static object like this.
I do not have this inside of an onClick method yet, do I have to do that in order for me to access the static session variable? It's basically being called the moment the page loads.