1
我想知道如何在vaadin標籤頁中動態添加選項卡。我有TabSheet由兩個選項卡組成。第一個選項卡有一個按鈕。如果我們單擊該按鈕,則另一個選項卡應該在選項卡中動態添加。可以告訴我如何實現此目的。如何在vaadin中動態添加選項卡?
我想知道如何在vaadin標籤頁中動態添加選項卡。我有TabSheet由兩個選項卡組成。第一個選項卡有一個按鈕。如果我們單擊該按鈕,則另一個選項卡應該在選項卡中動態添加。可以告訴我如何實現此目的。如何在vaadin中動態添加選項卡?
查看演示,代碼示例和API文檔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);
}
}