I have nested dynamic components, essentially dynamic tabs that contain dynamic trees, both of which are created via two different managed beans.
The problem is that when a selection is made in a tree under a different tab, the selected Node is updated in the PlayerController class, but other trees maintain their selection visually . Is there a way to clear all trees selection when tabs in the accordian panel change?
Code: Select all
<p:accordionPanel id="teamsAP" activeIndex="0" var="team" value="#teamController.teams}" dynamic="true">
<!-- Dynamic Tab Goes Here -->
<p:tab title="#{team.name}">
<!-- Dynamic Tree Goes Here -->
<p:tree value="#{playerController.getTree(team.name)}" var="node" dynamic="true" cache="false" selectionMode="single" selection="#{teamController.selectedNode}">
<p:ajax event="select" listener="#{taskController.onNodeSelect}" />
<p:ajax event="unselect" listener="#{taskController.onNodeUnselect}" />
<p:treeNode>
<h:outputText value="#{node}" />
</p:treeNode>
</p:tree>
</p:tab>
</p:accordionPanel>