To implement this we have done following:
1. Defined tab view with empty tab.
2. On tab change we check which tab is currently selected and depending on this define which
3. Updating with ajax output panel which includes some page
Code: Select all
<p:outputPanel id="mainAppFrame">
<ui:include src="#{appPreferences.includePage}"/>
</p:outputPanel>
Code: Select all
#{appPreferences.includePage}
This approach worked well with PrimeFaces 2.2.x. The code was following:
Code: Select all
<p:tabView dynamic="true" cache="false" onTabChangeUpdate="mainAppFrame" tabChangeListener="#{appPreferences.onTabChange}">
<p:tab id="someTab"/>
<p:tab id="someOtherTab"/>
</p:tabView>
<p:outputPanel id="mainAppFrame">
<ui:include src="#{appPreferences.includePage}"/>
</p:outputPanel>
But this does not work anymore with PrimeFaces 3.0RC1-SNAPSHOT. I've changed the code to be
Code: Select all
<p:tabView dynamic="true" cache="false">
<p:ajax event="tabChange" listener="#{appPreferences.onTabChange}" update="mainApplicationFrame"/>
<p:tab id="someTab"/>
<p:tab id="someOtherTab"/>
</p:tabView>
<p:outputPanel id="mainAppFrame">
<ui:include src="#{appPreferences.includePage}"/>
</p:outputPanel>
It looks like a defect but I wanted to hear some more thoughts on this.
Thanks,
Serhiy