@@ -0,0 +1,1895 @@
+package com.vaadin.tests.layouts;%0A%0Aimport com.vaadin.tests.components.TestBase;%0Aimport com.vaadin.ui.Button;%0Aimport com.vaadin.ui.TextField;%0Aimport com.vaadin.ui.VerticalLayout;%0Aimport com.vaadin.ui.Button.ClickEvent;%0Aimport com.vaadin.ui.Button.ClickListener;%0A%0A@SuppressWarnings(%22serial%22)%0Apublic class MovingInvisibleField extends TestBase %7B%0A%0A    @Override%0A    protected void setup() %7B%0A        final VerticalLayout layout1 = new VerticalLayout();%0A        final VerticalLayout layout2 = new VerticalLayout();%0A%0A        final TextField tfHidden = new TextField(%22Hidden text field caption%22,%0A                %22A hidden text field%22);%0A        final TextField tfVisible = new TextField(%22Visible text field caption%22,%0A                %22A visible text field%22);%0A        tfHidden.setVisible(false);%0A        Button b = new Button(%22Move hidden textfield to other layout%22);%0A        b.addListener(new ClickListener() %7B%0A%0A            public void buttonClick(ClickEvent event) %7B%0A                if (layout1.getComponentIndex(tfHidden) != -1) %7B%0A                    layout2.addComponent(tfVisible);%0A                    layout2.addComponent(tfHidden);%0A                %7D else %7B%0A                    layout1.addComponent(tfVisible);%0A                    layout1.addComponent(tfHidden);%0A                %7D%0A%0A            %7D%0A%0A        %7D);%0A%0A        layout1.addComponent(tfVisible);%0A        layout1.addComponent(tfHidden);%0A%0A        addComponent(layout1);%0A        addComponent(b);%0A        addComponent(layout2);%0A    %7D%0A%0A    @Override%0A    protected String getDescription() %7B%0A        return %22Above and below the button is a VerticalLayout. Initially the first one contains two components: a visiable and an invisible TextField. Click the button to move the TextFields to the second layout, both should be moved but only the visible rendered.%22;%0A    %7D%0A%0A    @Override%0A    protected Integer getTicketNumber() %7B%0A        return 5278;%0A    %7D%0A%7D%0A

Test case for #5278