简体   繁体   English

将JSF树与文件夹目录同步

[英]Synchronize JSF Tree with Folder Directory

I have to keep the user uploaded files under a directory by category. 我必须按类别将用户上载的文件保留在目录下。 The application directory have to show this directory as tree on web page. 应用程序目录必须将此目录显示为网页上的树。 I am using JSF 2.0 + Richfaces 4.0. 我正在使用JSF 2.0 + Richfaces 4.0。 I have to make programmatically to show directories structure with tree on web page. 我必须以编程方式在网页上显示带有树的目录结构。 Any one provide the API or lib to get recursive directory structure from my root level directory? 有人提供API或lib来从我的根目录获取递归目录结构吗?

Use recursiveTreeNodesAdaptor & treeNodesAdaptor components 使用recursiveTreeNodesAdaptor和treeNodesAdaptor组件

live demo : http://livedemo.exadel.com/richfaces-demo/richfaces/treeNodesAdaptor.jsf?c=recursiveTreeNodesAdaptor 现场演示: http : //livedemo.exadel.com/richfaces-demo/richfaces/treeNodesAdaptor.jsf?c=recursiveTreeNodesAdaptor

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">

    <h:form>    
        <rich:tree style="width:300px" switchType="ajax" stateAdvisor="#{treeDemoStateAdvisor}">
            <rich:recursiveTreeNodesAdaptor roots="#{fileSystemBean.sourceRoots}" var="item" nodes="#{item.nodes}" />
        </rich:tree>
    </h:form>

</ui:composition>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM