0
public class Tabs {
public Tabs() {
fc = FacesContext.getCurrentInstance();
tabView = (TabView) fc.getApplication().createComponent(
"org.primefaces.component.TabView");
Tab tab1 = new Tab();
tab1.setTitle("Default tab");
Tab tab2 = new Tab();
tab2.setTitle("Manage Favorites");
tab2.setClosable(true);
tabView.getChildren().add(tab1);
tabView.getChildren().add(tab2);
tabView.setActiveIndex(0);
}
public TabView getTabView() {
return tabView;
}
public void setTabView(TabView tabView) {
this.tabView = tabView;
}
public void addTabs() {
Tab tab3 = new Tab();
tab3.setTitle("Manage Favorites");
tab3.setClosable(true);
tabView.getChildren().add(tab3);
System.out.println("Called");
}
FacesContext fc;
TabView tabView;
}
這是我們在tabview中添加選項卡的bean。作品完全沒問題..在PrimeFaces選項卡視圖
<p:tabView id="mytabview" orientation="left" binding="#{Tabs.tabView}"
style="position:relative" rendered="true" styleClass="tabs">
</p:tabView>
這顯示標籤,但它完全是空的。我想在這些標籤中添加面板網格。
問題是:如何在編程結束時添加一個panelgrid,以便標籤視圖顯示一些信息。