Modify Dynamic Elements

UI Components for JSF
Post Reply
Xitesmai
Posts: 1
Joined: 08 Sep 2011, 23:14

08 Sep 2011, 23:22

I'm not even sure if this is possible, but I thought I would ask.

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>

piogwi
Posts: 19
Joined: 29 Aug 2011, 08:31

09 Sep 2011, 10:50

Try tu use "update" property for the tree, and update all tabs after selection.
Try to use "nodeSelectListener" instead of p:ajax event="select".

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests