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
Post a Comment