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?

Thanks.

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

Please
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.

@Henri
@Marlon

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.

Kurt:

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


public class TabSheetTestApp extends Application {

        @Override
        public void init() {
                Window mainWindow = new Window("TabSheetTestApp");
                mainWindow.setSizeFull();

                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();
                mainWindow.addComponent(tabSheet);

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

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

                setMainWindow(mainWindow);
        }
}