First the p:tabView should be bound to managed bean, so that we can access the UIComponent from code:
< !-- bind to a bean property so that we can manipulate it later in code:
http://stackoverflow.com/questions/4052581/dynamically-generate-tabs-with-primefaces/4722270#4722270 -->
< p:tabView id="tabs" binding="#{tabController.view}" />
The bean must at least contain the setters and be requestScoped:
@ManagedBean
@RequestScoped
public class TabController {
private TabView view;
public TabView getView() {
return view;
}
public void setView(TabView view) {
this.view = view;
}
Then a new tab can be added from process logic. Its seems to be a little tricky to pass the start parameters correctly. They must be passed a string el-expression even if the object behind it is already resolved elsewhere:
![alt text][1]
The full demo project can be downloaded here: [ComponentCreation_51.iar][2]
[1]: http://answers.axonivy.com/upfiles/tabController.pnghttps://answers.axonivy.com/upfiles/tabController.png
[2]: http://developer.axonivy.com/q-and-a-attachments/componentCreation_51.iar/upfiles/componentCreation_51.iar