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>
Value
Code: Select all
#{appPreferences.includePage}is updated dynamically depending on what tab is selected.
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>
The problem is that appPreferences.getIncludePage() is called before appPreferences.onTabChange. This means that page is prepared for rendering before ajax listened is called. This makes impossible to update the page depending on the listener logic.
It looks like a defect but I wanted to hear some more thoughts on this.
Thanks,
Serhiy
