title: Primefaces TreeTable sorting freze collapse
body: <p>is it possible to keep the behaviour more stable?</p>
  
  <p>what I have:
  an Tree table with 3 columns, first has collapsed stuff in it
  if I open one and close it, then click on sort
  it is open after that</p>
  
  <p>what I would like to have:
  keep it closed if it was closed before sort</p>
  
  <pre><code> &lt;h:form id="form"&gt;
      &lt;p:treeTable value="#{ttBasicView.root}" var="document"&gt;
          &lt;f:facet name="header"&gt;
              FritzBox Smart Home Daten
          &lt;/f:facet&gt;
          &lt;p:column headerText="Name" &gt;
              &lt;h:outputText value="#{document.name}" /&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="Gesamtverbrauch (in kWh)" sortBy="#{document.gesamtverbrauch}" actionListener="#{BasicView.expandAll}"&gt;
              &lt;h:outputText value="#{document.gesamtverbrauch}" /&gt;
          &lt;/p:column&gt;
          &lt;p:column headerText="aktuelle Temperatur" sortBy="#{document.akttemperatur}"&gt;
              &lt;h:outputText value="#{document.akttemperatur}" /&gt;
          &lt;/p:column&gt;
          &lt;p:column style="width:24px"&gt;
              &lt;p:commandLink update=":form:documentPanel" oncomplete="PF('documentDialog').show()" title="View Detail" styleClass="ui-icon ui-icon-search"&gt;
                  &lt;f:setPropertyActionListener value="#{document}" target="#{ttBasicView.selectedDocument}" /&gt;
              &lt;/p:commandLink&gt;
          &lt;/p:column&gt;
  
      &lt;/p:treeTable&gt;
  
      &lt;p:dialog id="dialog" header="Document Detail" showEffect="fade" widgetVar="documentDialog" modal="true" resizable="false"&gt;
          &lt;p:outputPanel id="documentPanel"&gt;
              &lt;p:panelGrid  columns="2" columnClasses="label,value" rendered="#{not empty ttBasicView.selectedDocument}"&gt;
                  &lt;h:outputLabel for="name" value="Name: " /&gt;
                  &lt;h:outputText id="name" value="#{ttBasicView.selectedDocument.name}" style="font-weight:bold" /&gt;
  
                  &lt;h:outputLabel for="gesamtverbrauch" value="Gesamtverbrauch: " /&gt;
                  &lt;h:outputText id="gesamtverbrauch" value="#{ttBasicView.selectedDocument.gesamtverbrauch}" style="font-weight:bold" /&gt;
  
                  &lt;h:outputLabel for="akttemperatur" value="aktuelle Temperatur: " /&gt;
                  &lt;h:outputText id="akttemperatur" value="#{ttBasicView.selectedDocument.akttemperatur}" style="font-weight:bold" /&gt;
              &lt;/p:panelGrid&gt;
          &lt;/p:outputPanel&gt;
      &lt;/p:dialog&gt;
  
  &lt;/h:form&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/MB4Hx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MB4Hx.jpg" alt="before sort"></a>
  <a href="https://i.stack.imgur.com/yc8do.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yc8do.jpg" alt="after sort"></a></p>