-
12 Jun 2008 5:24 AM #1
Feature Request: Closeable TabItem with possibility to abort closing
Feature Request: Closeable TabItem with possibility to abort closing
Hi,
I would like to implement a closeable TabItem that asks a confirmation message when the close button is clicked and aborts the closing if the user does not confirm.
IMHO, this would be possible if TabPanel could be expanded a bit at line 740, currently:
void onItemClick(TabItem item, ComponentEvent ce) {
ce.stopEvent();
Element target = ce.getTarget();
if (fly(target).getStyleName().equals("x-tab-strip-close")) {
remove(item);
item.fireEvent(Events.Close, new TabPanelEvent(this, item));
return;
} else if (item != activeItem) {
setSelection(item);
}
}
It should fire an Events.BeforeClose event and conditionally execute the remove item. Should be realizable in a few minutes and would help me a great deal.
Thanks,
Joachim
-
12 Jun 2008 12:22 PM #2
TabPanel does support
Code:BeforeRemove : TabPanelEvent(tabPanel, item) Fires before a item is removed. Listeners can set the doit field to false to cancel the action. * tabPanel : this * item : the item being removed
does that not work as expected?
-
12 Jun 2008 12:34 PM #3
TabItem now fires a BeforeClose event which can be canceled. Also, TabPanel was updated so that BeforeRemove is fired before the item has been closed.
Fixes are in SVN.
-
12 Jun 2008 11:34 PM #4


Reply With Quote