I have a TabView whose tabs i generated with :
<p:tabView>
<c:forEach var="app" items="#{data.apps}">
<p:tab title="#{app.name}" closable="true" id="app_#{app.id}">
<object data="#{app.startUri}" height="800" width="1150" />
</p:tab>
</c:forEach>
</p:tabView>
However, I had a problem with adding new tabs. I had to update the TabView which caused the tabs and their contents to reload which was a problem for my situation.
I then switched to create my TabView with a TabViewHelper bean.
But then there was a problem with adding the object tag as a child to the tab:
public TabView initializeTabView(List<App> apps) {
tv = new TabView();
Tab tab;
for (App app : apps) {
tab = new Tab();
tab.setTitle(app.getName());
HTMLObjectElementImpl content = new HTMLObjectElementImpl(owner, "test-object");
tab.getChildren().add(content);
tv.getChildren().add(tab);
}
return tv;
}
I get the following error:
The method add(UIComponent) in the type List is not applicable for the arguments (HTMLObjectElementImpl)
I can only add an UIComponent.
I'm not sure if HTMLObjectElementImpl is right for <object>
but I did not find something better.
Is there an UIComponent for the HTML <object>
-tag or is there another class available for HTML <object>
?
Did anyone else have this problem and found a solution?