Use of the p:tabview component of Primefaces

Asked

Viewed 392 times

0

I’m using the p:tabview component of Primefaces:

<p:tabView dynamic="true" id="tab_view">
    <c:forEach items="#{tabbedView.listOfTabs}" var="listOfTabs">
     <p:tab title="#{listOfTabs.name}" closable="true">
         <ui:include src="#{listOfTabs.xhtmlIncluded}" />
     </p:tab>
    </c:forEach>
</p:tabView>

listOfTabs is an object list array that has two fields: name and xhtmlIncluded. The problem is that when I open two tabs using the same xhtml, JSF points to component name duplicity, for example:

javax.servlet.Servletexception: The tab_view:form component ID has already been found in the view.

I have to be able to open two tabs that carry the same xhtml. I use sessionscoped on my bean.

Someone’s been through this trouble?

  • I was able to solve the problem by adding a ui:param to the <ui:include, and this should be unique: <ui:param name="idPrefix" value="#{listOfTabs.id}"/>

  • http://stackoverflow.com/questions/21552654/avoiding-duplicate-ids-when-reusing-facelets-compositions-in-the-same-naming-con

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.