Uploaded image for project: 'MyFaces Tomahawk'
  1. MyFaces Tomahawk
  2. TOMAHAWK-925

Improve Tree2 data model usability

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.1.5-SNAPSHOT
    • None
    • Tree2
    • None

    Description

      There're two specific issues that should be addressed in my opinion
      1) if you use t:commandLink action inside t:tree2 it's very difficult to get hold of the actual node object that was clicked
      2) not possible to use existing or business logic tree structures directly with t:tree2

      1) Currently I'm constructing the TreeNode structure so that the identifiers are actually paths to the node from the root node (this special node id semantics doesn't seem to be documented). Then in a backing bean I use
      TreeNode.getNodeById(selectedNodePath);
      to get the actual node object reference. Since I'm required to assign the node path as the identifier, there's no fields in the structure for identifying the business id of the object. This forces me to always subclass TreeNodeBase.

      Oracle ADF Faces af:tree / TreeModel is much more intuitive since it follows the standard JSF h:dataTable / DataModel API pattern:

      public NavigatorBacking {
      TreeModel tree;

      public String nodeSelected() {
      if(tree.isRowAvailable())

      { MyNode n = (MyNode)tree.getRowData(); // ... }

      return "success";
      }
      }

      2) the tree nodes are required to be of TreeNode type or its subclass. Suppose I have a tree hierarchy that I construct in the business tier and want to render this to the user through the UI. I need to rebuild the tree in the web tier with TreeNode nodes (and assign identifiers correctly). Typically one or more TreeNodeBase subclasses are also required. This adds development as well as performance overhead. AFAIK, the ADF Faces TreeModel (ChildPropertyTreeModel) can be populated with any JavaBeans based structure which makes it much more user friendly.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aspa Marko Asplund
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: