How to add Tabs dynamically in vaadin?
I want to know how to 开发者_C百科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);
}
}
精彩评论