PDA

View Full Version : TabItem + Event ?



Michi_de
27 Oct 2008, 1:00 AM
Hi,

i used the search to find anything about TabItems and EventListeners. But it seems, that TabItem are not supposed to be subscribing to events? I just wanted to add a listener like this:



TabItem item = new TabItem();




item.addListener(Events.BeforeClose, new SelectionListener<ComponentEvent>( ){
publicvoid componentSelected(ComponentEvent be) {
// do something....

}

}
});

But i realy cant get this event going. Its just like TabItems cant subscribe to Events?

skanberg
27 Oct 2008, 1:38 AM
Try this:



tabItem.addListener(Events.BeforeClose, new Listener<TabPanelEvent>() {
public void handleEvent(TabPanelEvent be) {

}
});

gslender
27 Oct 2008, 2:05 AM
tabpanel has the events you need... listen for events against it.

Michi_de
27 Oct 2008, 2:08 AM
Thank you! It works.