TabSheet - No SelectedTabChangeEvent fired when selected Tab will be closed

Hi Vaadin-User,

First of all let me say that I see myself not as a Pro hacker. This is why I think I am not allowed to ascribe a bug to Vaadin. Therefore I just want to ask if the following is an intentional Vaadin behavior:

When closing the selected tab in a TabSheet the first tab on the left will be selected by Vaadin automatically. Or in other words the tab on the left will be at least highlighted as no SelectedTabChangeEvent is fired in this situation.

Why is that? Is there a reason why no SelectedTabChangeEvent is fired or could that be a bug?


If the tab selection changes then a SelectedTabChangeEvent should be fired. Sounds like a bug to me.

submit a bug report
. And don’t worry about not being a “Pro hacker”. If I may quote the page I just linked to: [quote]
worst tickets are often created by experienced programmers
[/quote] :slight_smile:

With respect to which tab is selected, see also
ticket #5889

As for the event not being fired, please create a ticket as Marlon suggested.


Thank you very much for your replies and sorry for the late answer. I was quite busy.

Also I have to apologize for wasting your time. I create a simple test app (should have done this before) and there the SelectedTabChangeEvent is fired as selected. So no bug at all.


P.S.: For everybody who is interested in, the following is the test app I used:

public class TabSheetTestApp extends Application {

        public void init() {
                Window mainWindow = new Window("TabSheetTestApp");

                VerticalLayout l1 = new VerticalLayout();
                l1.addComponent(new Label("This is tab 1"));

                VerticalLayout l2 = new VerticalLayout();
                l2.addComponent(new Label("This is tab 2"));

                VerticalLayout l3 = new VerticalLayout();
                l3.addComponent(new Label("This is tab 3"));

                VerticalLayout l4 = new VerticalLayout();
                l4.addComponent(new Label("This is tab 4"));

                TabSheet tabSheet = new TabSheet();

                Tab tab1 = tabSheet.addTab(l1, "Tab ONE", null);
                Tab tab2 = tabSheet.addTab(l2, "Tab TWO", null);
                Tab tab3 = tabSheet.addTab(l3, "Tab THREE", null);
                Tab tab4 = tabSheet.addTab(l4, "Tab FOUR", null);

                tabSheet.addListener(new SelectedTabChangeListener() {
                        public void selectedTabChange(SelectedTabChangeEvent event) {
                                System.out.println("SelectedTabChangeEvent fired!");