5 Replies Latest reply on Apr 29, 2011 5:19 AM by david03

    Order of nodes in recursiveTreeNodesAdaptor

    alsha

      Hi *,

      I use following snippet from livedemo page to reproduce the
      structure of directories and files (recursive):

      <rich:recursiveTreeNodesAdaptor id="dir" var="dir"
       roots="#{project.dirs}" nodes="#{dir.directories}">
      
       <rich:treeNode>
       <h:commandLink action="#{dir.click}" value="Directory: #{dir.name}" />
       </rich:treeNode>
      
       <rich:treeNodesAdaptor id="file" var="file" nodes="#{dir.files}">
       <rich:treeNode>
       <h:commandLink action="#{file.click}" value="File: #{file.name}" />
       </rich:treeNode>
       </rich:treeNodesAdaptor>
      
      </rich:recursiveTreeNodesAdaptor>
      
      


      It works fine, but for some reason the order of directories and files is not correct: I see first the files and then the directories:

      dir1
      --file21
      --file22
      --dir21
      ----file31
      ----dir31
      --dir22

      But I want to have the 'normal' view (like Windows Explorer): first folders, then files. How can I reach this?

      Thanks for any help!