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

Tree2 does not use node IDs in expanding and collapsing

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Won't Fix
    • Affects Version/s: 1.1.0, 1.1.1, 1.1.2-SNAPSHOT
    • Fix Version/s: None
    • Component/s: Tree2
    • Labels:
      None

      Description

      The tree2 implementation in 1.1.1 and SVN current assumes node IDs are based on the index of the nodes and the hierarchy of the nodes.

      Example:

      A (0)
      B (0:0)
      C (0:1)
      D (0:1:0)

      Where the string in parenthesis represents what tree2 assumes the node ID is.
      If tree nodes have custom IDs that are unique to the tree (in this example, A, B, C, D could actually be the node IDs), the nodes will never be expanded or collapsed if the TreeState methods are used using the true node IDs.

      In the above example, "0:1" would be considered expanded, but "C" would not be considered expanded.

      This severly limits the developer of custom tree nodes and custom tree models.

      Requested fix:
      Expanded/collapsed node IDs should use the "TreeNode.getNodeId()" function. Each node should have a unique ID for the entire tree. This ID is NOT dependant on the parent's node ID. The TreeWalker in SVN current (1.1.3 code) and the HtmlTreeRenderer in 1.1.1 should not use the index of the node as the identifier, but instead use the ID of the node.

      In the above example, "0:1:0" type of notation should never be used by nodes (except maybe in the default node implementation). The tree should always use the TreeNode.getNodeId for all node identification.

        Activity

        Hide
        schof sean schofield added a comment -

        I'm a little confused here. The whole point of TreeWalker was that you would not have to rely on the default 0, 0:0 ,etc. naming scheme. I would agree with you that such a restriction would be a problem with dynamic trrees. Can you explain why you can't just implement your own TreeWalker with whatever naming scheme you choose? I haven't yet actually created my own dynamic tree so its possible I am missing something.

        Show
        schof sean schofield added a comment - I'm a little confused here. The whole point of TreeWalker was that you would not have to rely on the default 0, 0:0 ,etc. naming scheme. I would agree with you that such a restriction would be a problem with dynamic trrees. Can you explain why you can't just implement your own TreeWalker with whatever naming scheme you choose? I haven't yet actually created my own dynamic tree so its possible I am missing something.
        Hide
        arobinson74 Andrew Robinson added a comment -

        At the time I wasn't aware of the tree walker (was posted quite a while ago). Perhaps a WIKI or other documentation on the tree walker on how to make it use node IDs instead of node indexes.

        Show
        arobinson74 Andrew Robinson added a comment - At the time I wasn't aware of the tree walker (was posted quite a while ago). Perhaps a WIKI or other documentation on the tree walker on how to make it use node IDs instead of node indexes.
        Hide
        schof sean schofield added a comment -

        OK I 'm marking this won't fix since there doesn't seem to be a problem. If you come up with a working example maybe you could add it to the wiki yourself.

        Show
        schof sean schofield added a comment - OK I 'm marking this won't fix since there doesn't seem to be a problem. If you come up with a working example maybe you could add it to the wiki yourself.

          People

          • Assignee:
            schof sean schofield
            Reporter:
            arobinson74 Andrew Robinson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development