I'm using PrimeFaces and I have next jsf page:
<h:form id="form1111">
<p:commandLink value="Include Page" actionListener="#{dynaInclBean.includePage}" update="dynInclTabView"/>
<p:tabView id="dynInclTabView" dynamic="true">
<p:tab title="Somename" binding="#{dynaInclBean.tab}"/>
</p:tabView>
</h:form>
My backing bean:
private Tab tab;
public Tab getTab() {
return tab;
}
public void setTab(Tab tab) {
this.tab = tab;
}
public void includePage() throws IOException
{
FaceletContext faceletContext = (FaceletContext) FacesContext.getCurrentInstance().getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
faceletContext.includeFacelet(tab, "playerPhoto.xhtml");
}
I want to include page to the tab. When I calling inlcudePage() I get an exception: org.apache.myfaces.view.facelets.el.ContextAwareELException: javax.el.ELException: java.lang.NullPointerException
What am I doing wrong?