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,以便标签视图显示一些信息。