PrimeFaces Tree可滚动固定大小

use*_*246 4 tree scroll primefaces

我的primefaces应用程序中有一个巨大的树组件.树有数百个节点,我希望树在我的UI中具有固定的高度,垂直滚动以导航节点.

有人可以帮我解决这个问题吗?谢谢

Had*_*deh 10

将该树放在面板中,然后将样式应用于该面板.例如:

<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>
Run Code Online (Sandbox Code Playgroud)