@@ -0,0 +1,1734 @@
+package com.itmill.toolkit.tests.tickets;%0A%0Aimport com.itmill.toolkit.Application;%0Aimport com.itmill.toolkit.ui.Button;%0Aimport com.itmill.toolkit.ui.CustomComponent;%0Aimport com.itmill.toolkit.ui.Label;%0Aimport com.itmill.toolkit.ui.OrderedLayout;%0Aimport com.itmill.toolkit.ui.TabSheet;%0Aimport com.itmill.toolkit.ui.Window;%0Aimport com.itmill.toolkit.ui.Button.ClickEvent;%0Aimport com.itmill.toolkit.ui.Button.ClickListener;%0A%0Apublic class Ticket2289 extends Application %7B%0A%0A    TabSheet ts;%0A%0A    public void init() %7B%0A%0A        Window w = new Window();%0A        setMainWindow(w);%0A        OrderedLayout ol = new OrderedLayout();%0A        w.setLayout(ol);%0A%0A        w%0A                .addComponent(new Label(%0A                        %22When one tab is removed by clicking 'close a tab', client side get's mixed up.%22));%0A%0A        Button b = new Button(%22close a tab%22);%0A        b.addListener(new ClickListener() %7B%0A%0A            @Override%0A            public void buttonClick(ClickEvent event) %7B%0A                closeCurrentTab();%0A%0A            %7D%0A%0A        %7D);%0A        ol.addComponent(b);%0A        ts = new TabSheet();%0A%0A        ts.addTab(new MyTab(%22tab one%22), %22Caption1%22, null);%0A        ts.addTab(new MyTab(%22tab two%22), %22Caption2%22, null);%0A        ts.addTab(new MyTab(%22tab three%22), %22Caption3%22, null);%0A        ts.addTab(new MyTab(%22tab four%22), %22Caption4%22, null);%0A        ol.addComponent(ts);%0A%0A    %7D%0A%0A    private void closeCurrentTab() %7B%0A        MyTab m = (MyTab) ts.getSelectedTab();%0A        if (m != null) %7B%0A            ts.removeComponent(m);%0A        %7D%0A    %7D%0A%0A%7D%0A%0Aclass MyTab extends CustomComponent %7B%0A    public MyTab(String text) %7B%0A        OrderedLayout ol = new OrderedLayout();%0A        setCompositionRoot(ol);%0A        ol.addComponent(new Label(text));%0A    %7D%0A%7D

Test for 2289 added