@@ -0,0 +1,2100 @@
+package com.vaadin.tests.components.tabsheet;%0D%0A%0D%0Aimport com.vaadin.tests.components.TestBase;%0D%0Aimport com.vaadin.ui.Button;%0D%0Aimport com.vaadin.ui.Button.ClickEvent;%0D%0Aimport com.vaadin.ui.Button.ClickListener;%0D%0Aimport com.vaadin.ui.Component;%0D%0Aimport com.vaadin.ui.HorizontalLayout;%0D%0Aimport com.vaadin.ui.Label;%0D%0Aimport com.vaadin.ui.TabSheet;%0D%0Aimport com.vaadin.ui.TextField;%0D%0A%0D%0Apublic class TabSheetDiscardsMovedComponents extends TestBase implements%0D%0A        ClickListener %7B%0D%0A%0D%0A    private static final long serialVersionUID = 3153820728819626096L;%0D%0A%0D%0A    private Component c1 = new TextField(%22Component 1%22, %22TextField 1%22);%0D%0A    private Component c2 = new Button(%22Component 2%22);%0D%0A%0D%0A    private TabSheet ts = null;%0D%0A    private Button moveButton = new Button(%22Move components to new tabsheet%22,%0D%0A            this);%0D%0A    private Button moveAndSelectButton = new Button(%0D%0A            %22Move components to new tabsheet and remove previous tabsheet%22,%0D%0A            this);%0D%0A%0D%0A    private HorizontalLayout hl;%0D%0A%0D%0A    @Override%0D%0A    public void setup() %7B%0D%0A        hl = new HorizontalLayout();%0D%0A%0D%0A        hl.addComponent(moveButton);%0D%0A        hl.addComponent(moveAndSelectButton);%0D%0A%0D%0A        recreateTabSheet();%0D%0A%0D%0A        hl.addComponent(ts);%0D%0A        addComponent(hl);%0D%0A    %7D%0D%0A%0D%0A    private void recreateTabSheet() %7B%0D%0A        ts = new TabSheet();%0D%0A        ts.addTab(c1);%0D%0A        ts.addTab(c2);%0D%0A    %7D%0D%0A%0D%0A    public void buttonClick(ClickEvent event) %7B%0D%0A        if (event.getButton() == moveAndSelectButton) %7B%0D%0A            hl.removeComponent(ts);%0D%0A        %7D%0D%0A        ts.addTab(new Label(%22Old tabsheet%22), %22Old tabsheet%22, null);%0D%0A        recreateTabSheet();%0D%0A        hl.addComponent(ts);%0D%0A%0D%0A    %7D%0D%0A%0D%0A    @Override%0D%0A    protected String getDescription() %7B%0D%0A        return %22Moving components from one TabSheet to another should not cause problems. Click the second tab and then a button to move the components to another TabSheet and the caption of the Button or the contents of the TextField will disappear%22;%0D%0A    %7D%0D%0A%0D%0A    @Override%0D%0A    protected Integer getTicketNumber() %7B%0D%0A        return 2669;%0D%0A    %7D%0D%0A%0D%0A%7D%0D%0A

Test for #2669