I'm dealing with a problem with my TreeTable concerning the server-side saving of expand-state of nodes when collapsing.
First of all, here's the snippet:
Code: Select all
<p:treeTable value="#{ctrl.treeRoot}" var="row" id="myTree" selectionMode="single" selection="#{ctrl.selectedNode}">
<p:ajax event="expand" process="@this" />
<p:ajax event="collapse" process="@this" />
<p:column>
<h:outputText value="#{row.title}" />
</p:column>
</p:treeTable>
To see that the collapsed state is not set on server-side, one can change the second p:ajax tag to the following:
Code: Select all
<p:ajax event="collapse" process="@this" update="myTree" />
So, every time I use update="myTree" from any other UI element, the tree gets all nodes expanded that the user ever(!) opened earlier.
I want, that on collapsing a row, the corresponding TreeNode gets the property setExpanded(false) set.
Is there any workaround for this or am I doing something wrong?
Technical info: Primefaces 3.3.1, MyFaces 2.1.7 with Facelets, Tomcat 6.0
I appreciate any help on this. Thanks in advance!