-
FEATURED COMPONENTS
First time here? Check out the FAQ!
there's a iframe whose parent is a tabpanel,and a page called innerpage was setted as the src of the iframe.I want to close the tab and tabpanel in innerpage.How could i achieve this ?
in outerpage.zul :
-------------------------------------------------------------
<?page id="outerpage"?>
<tabbox panelSpacing="50px" id="tabbox" height="99%">
<tabs id="tabs">
<tab label="tab1" />
</tabs>
<tabpanels id="panels">
<tabpanel>
<include src="innerpage.zul" />
</tabpanel>
</tabpanels>
</tabbox>
---------------------------------------------------------------
and now ,I want to close the tab from innerpage.zul.
How could I write the behaver of the close_button in innerpage.zul ?
in addtion,This is a demo, in my real program,the tab and tabpanel was created dynamicly.
innerpage.zul:
----------------------------------------------------------
<toolbarbutton label="Close this Tab" id=" close_button" />
---------------------------------------------------------
another question :is it possible to close all tabs in outerpage like a browser called maxthon does ?
thanks for any advise !
I've got a way:
first detach the tabpanel and then detach the tab:
tabpanel1.detach();
tab1.detach();
but i have to find which tab is linked to the current tabpanel.
could i use tabpanel1.getLinkedTab().detach()?
but this returns an Null Pointer Exception.
could anyone please help me ?thanks!
The implementation is really count on index of the Tab and Tabpanel.
1. check the index of the Tab in Tabs.
2. find the Tabpanel in Tabpanels per the index.
Maybe you want to check the number of the Tab and Tabpanel. In other words, you have to get the tab panel before you detach Tab.
Asked: 2009-02-25 09:15:00 +0800
Seen: 956 times
Last updated: Mar 12 '09