• Type: Sub-task Sub-task
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: Components/Renderers
    • Labels:
    • Status Whiteboard:

      size_large importance_medium

      size_large importance_medium


      With the integration of Facelets into JSF 2.0 a component for iterating over list data (UIRepeat) that does not render any markup itself was introduced in the spec. This is very useful for creating "table" like composite components that render custom markup.
      A similar component for rendering hierarchical data does not exist. There should be a general component(s) for iterating tree structures e.g. "UITreeData", that does not render any output itself but allows rendering of hierarchical HTML tree structures like <ul><li>.
      There is currently no support of rendering hierarchical data structures with facelets/composite components with an unlimited depth (and user defined markup). Nesting a composite component inside itself is not an option as it leads to an infinitely nested component tree.

      A component that only iterates a hierarchical data structure would allow creating "tree" like composite components that render custom markup.

      The usage could look something like:
      <ui:tree value="#


      " var="node" varStatus="status">
      <li>Node value: #


      <ui:treeChilds />

      It is possible to implement a similar "workaround" component on top of UIData with a special renderer for UIData + UIColum and a UIOutput for the "tree childs". The iteration over the tree nodes can be recursively done in the renderer of the "tree childs".
      Using UIData as the wrapping base component saves the developer from implementing the complicated state saving and tree visiting. The downside is: it is not easy to "trick" UIData to use hierarchical data with a special DataModel. This is because it only supports an integer as the index of the current row. A more general base class would be much more suitable. See improvement JAVASERVERFACES_SPEC_PUBLIC-963.
      BTW: The described "workaround" component is used on the CeBit site ( and even supports AJAX out of the box. I may provide the source for illustration.

      I think the suggested component really should be part of the spec as it significantly enhances the possibilities when creating composite components. Creating an own tree component is easy with it. It could also be a base for many other "tree" component implementations.



          • Assignee:
            Mathias Werlitz
          • Votes:
            2 Vote for this issue
            3 Start watching this issue


            • Created: