primefaces - avoid nodes of p:treeTable to collapse after update -


i have p:treetable in form , p:dialog in form p:dialog add data p:treetable

on submit of h:commandbutton of dialog add update of p:treetable in orded see added node

the issue expanded nodes user has opened collapse

i found question avoiding collapsing of p:treetable after update in question wrote solved no answer or solution question

to avoid collapsing or expanding have mark node on java side collapsed or expanded. that add ajax calls , listener methods.

jsf/faces:

<p:tree ...>     <p:ajax event="expand" listener="#{backing.nodeexpand}" />     <p:ajax event="collapse" listener="#{backing.nodecollapse}" /> ... </p:tree> 

java/backing:

public void nodeexpand(nodeexpandevent event) {     event.gettreenode().setexpanded(true);       }  public void nodecollapse(nodecollapseevent event) {     event.gettreenode().setexpanded(false);      } 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -