문제

I want to know how to add tab dynamically in vaadin tabsheet. I am having TabSheet which consists of two tabs. First tab has one button.If we click that button then another tab should add dynamically in the tabsheet.Can anyone tell me how to achieve this.

도움이 되었습니까?

해결책

Check out the demos, code samples, and API docs here.

final TabSheet tabSheet = new TabSheet();

Button button = new Button("Add the tab");
button.addListener(new Button.ClickListener(){
    public void buttonClick(ClickEvent event) {
        VerticalLayout content = new VerticalLayout();
        content.addComponent(new Label("This is the tab content."));
        Tab tab = tabSheet.addTab(content, "The new Tab", null);
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top