Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PrimeFaces Tree scrollable fixed size

I have a huge tree component in my primefaces application. The tree has hundreds of nodes and I want the tree to have fixed height in my UI with vertical scroll to navigate the nodees.

Can someone help me figure this out? Thanks

like image 723
user3348246 Avatar asked Mar 07 '14 13:03

user3348246


2 Answers

Put that tree in a panel and then apply style to that panel. For example:

<p:outputPanel style="width: 100%;height: 100px;overflow: auto;display: block">
       <p:tree value="#{bean.root}">
              <p:treeNode>  
                    <h:outputText value="#{doc}" />
              </p:treeNode>
       </p:tree>
</p:outputPanel>
like image 68
Hadi Momenzadeh Avatar answered Oct 20 '22 23:10

Hadi Momenzadeh


I use p:scrollPanel

<p:scrollPanel style="height:450px;width:500px;">
    <p:tree ...>
    </p:tree>           
</p:scrollPanel>
like image 1
Zaw Than oo Avatar answered Oct 20 '22 23:10

Zaw Than oo