Hi All,

I have an application in which tab panels are used to display and
gather input data from the users.
In some occations we need to catch a closing event on a tab and then
ask the user whether he/she needs to save before close.
I will show you the code i have made in order to catch this event when
tabpanels are removed from the container holding them.

The code in onRemove is not called everytime a tab is closed even
though the javadoc says:
Fires after any Component is removed from the container.
Strangely the code is run if I close a not active tab and if the tab
is the last tab in the container (not when the tab i close is the
active one).


// hide the panel when the tab is closed
                centerPanel.addListener(new TabPanelListenerAdapter() {
                        public boolean doBeforeTabChange(TabPanel source, Panel 
newPanel,
Panel oldPanel) {
                                WindowMgr.hideAll();
                                return true;
                        }

                        public void onRemove(Container self, Component 
component) {
                                component.hide();
                                //TODO KILL tab upon close...see how _2operate 
panel is
constructed...
                                //component.destroy();
                        }

                        // hide the panel when the tab is closed
                centerPanel.addListener(new TabPanelListenerAdapter() {
                        public boolean doBeforeTabChange(TabPanel source, Panel 
newPanel,
Panel oldPanel) {
                                WindowMgr.hideAll();
                                return true;
                        }
                        //Expect this code to run when a tab is closed
                        public void onRemove(Container self, Component 
component) {

                        }

                        public void onContextMenu(TabPanel source, Panel tab, 
EventObject
e) {
                                showMenu(tab, e);
                        }
                });
                });


Has any of you seen the same issue or what am I doing wrong here??
Hope for your help as this is a very important thing for our
application.
-Dan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to