On an XPage I have a navigator that sets a sessionScope variabl based on the item selected. I was then using that value in a SwitchFacet to display one of several different views. And this worked well but I understand that the switchFacet loads the whole tree for all the views where as a dynamicContent control only load the tree for the selected panel. So I created a dynamicContent control inside a panelAll on the XPage (the Navigator does a partial refreesh of panelAll onClick) using the following code:
<xp:panel id="panelAll" style="width:auto">
<xe:dynamicContent id="dynamicContent1">
getComponent("dynamicContent1").show(sessionScope.get("ssSelectedView");
<xp:this.facets>
<xp:panel xp:key="vwProfile">
<xc:ccProfileView></xc:ccProfileView>
</xp:panel>
<xp:panel xp:key="vwPending">
<xc:ccTransactionView></xc:ccTransactionView>
</xp:panel>
<xp:panel xp:key="vwAgentLog">
<xc:ccAgentView></xc:ccAgentView>
</xp:panel>
</xp:this.facets>
</xe:dynamicContent>
</xp:panel>
The problem is that the views do not change like they do with the switchFacet. I know that the sessionScope variable id being set correctly and the onClick partial refresh should be refreshing the panelAll and picking a different panel to load but it only displays the vwProfile view. Is there something else I need to do to make the dynamic content work?