aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/layouts/CssLayoutRemoveComponentWithCaption.java
blob: 2946500a400117fb0d7ff1a6748cb70a8ab7bc51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.vaadin.tests.layouts;

import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.CssLayout;
import com.vaadin.v7.ui.TextField;

public class CssLayoutRemoveComponentWithCaption extends TestBase {

    @Override
    protected void setup() {
        final CssLayout layout = new CssLayout();
        final TextField tf = new TextField("Caption");
        Button b = new Button("Remove field and add new", event -> {
            layout.removeComponent(tf);
            addComponent(new TextField("new field"));
        });
        layout.addComponent(tf);
        layout.addComponent(b);

        addComponent(layout);
    }

    @Override
    protected String getDescription() {
        return "Clicking on the button should remove the text field and add a new 'new field' text field";
    }

    @Override
    protected Integer getTicketNumber() {
        return 4204;
    }

}