SmartGWT version: v8.2p_2012-10-31/Pro Deployment (built 2012-10-31)
I have a tab in my application that hides or shows depending upon a condition. I also want to display an icon on this dynamic tab at times. However, I cannot seem to get this working. I've included some sample code that basically describes what I'm doing.
Note that, for the tabs that are permanent, I can display the icon just fine.
Any help would be greatly appreciated. Let me know if you have questions or need further information.
James
I have a tab in my application that hides or shows depending upon a condition. I also want to display an icon on this dynamic tab at times. However, I cannot seem to get this working. I've included some sample code that basically describes what I'm doing.
Note that, for the tabs that are permanent, I can display the icon just fine.
Any help would be greatly appreciated. Let me know if you have questions or need further information.
James
Code:
private TabSet tabs; public void makeTabSet() { tabs = new TabSet(); tabs.addTab(createTab("A", /* make A's panel */ ), 0); tabs.addTab(createTab("B", /* make B's panel */ ), 1); tabs.addTab(createTab("C", /* make C's panel */ ), 2); } private Tab createTab(String title, Canvas pane) { Tab t = new Tab(title); t.setID(title); t.setPane(pane); return t; } private void hideDynamicTab() { Tab t = tabs.getTab("B"); tabs.updateTab(t, null); tabs.removeTab(t); } private void showDynamicTab() { Tab t = tabs.getTab("B"); if (t == null) { tabs.addTab(createTab("B", /* make B's panel */ ), 1); } } private void showIconOnDynamicTab() { Tab t = tabs.getTab("B"); t.setIcon("path/to/icon.png"); } private void hideIconOnDynamicTab() { Tab t = tabs.getTab("B"); t.setIcon(null); }
Comment