Is there anyway to hide a tab which was already added to a TabSet ?
Announcement
Collapse
No announcement yet.
X
-
Hello,
I will bring this thread back to life, because removing tab from tabset will cause: "The pane associated with the removed tab is automatically destroyed... To avoid this, call updateTab with null as the new pane immediately before removing the tab.".
But, setting null as new pane for tab will cause override old pane (obviously) so you have keep old pane for later re-use. I am right?
Little example:
Code:public void onModuleLoad() { final TabSet ts = new TabSet(); ts.setSize("400px", "400px"); Tab tab1 = new Tab(); Button add = new Button("Add"); tab1.setPane(add); final Tab tab2 = new Tab(); final Button rem = new Button("Remove"); tab2.setPane(rem); ts.addTab(tab1); ts.addTab(tab2); ts.show(); add.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { tab2.setPane(rem); ts.addTab(tab2); } }); rem.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { ts.updateTab(tab2, null); ts.removeTab(tab2); } }); }
Comment
Comment