I have a view that is included in another view. I'm running into problems with f:metadata in the included view. Not sure how to go about it. I've updated both views and restarted the server. No luck.
Parent view
<ui:include src="sub_entityIndexPagination.xhtml">
<ui:param name="entityIndexBean" value="#{articleIndexBean}"/>
</ui:include>
Sub view
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
>
<f:metadata>
<f:viewParam name="pn" value="#{entityIndexBean.currentEntityPageNumber}" />
<f:event type="preRenderView" listener="#{entityIndexBean.toCurrentEntityPage()}" />
</f:metadata>
<c:forEach var="pageNumber" begin="1" end="${entityIndexBean.getEntityPageCount()}">
<h:outputLink value="ar_index.xhtml">
<h:outputText value="${pageNumber}" />
<f:param name="pn" value="${pageNumber}" />
</h:outputLink>
</c:forEach>
JSF Implementation
c:\tomee16\lib\myfaces-api-2.1.13.jar
Error
/sub_entityIndexPagination.xhtml at line 9 and column 14 <f:metadata> Parent UIComponent j_id_9 should be instance of UIViewRoot
phaseId=RENDER_RESPONSE(6)
Caused by:
javax.faces.view.facelets.TagException - /sub_entityIndexPagination.xhtml at line 9 and column 14 <f:metadata> Parent UIComponent j_id_9 should be instance of UIViewRoot
at org.apache.myfaces.view.facelets.tag.jsf.core.ViewMetadataHandler.apply(ViewMetadataHandler.java:60)