Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-1189

Tree Expand All Handling

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.9-core
    • 1.2.10-core, 1.0.10-core
    • Components
    • None
    • All

    Description

      Submitting a patch for the issue below. (I assume three +1 votes for the proposal means approval)

      There is some code in the Trinidad UIXTree which is intended to prevent the user from doing an unbounded "Expand All" on large trees (see UIXTree.broadcast() method. Specifically HierarchyUtils.__handleBroadcast()).

      The code counts the number of newly expanded nodes and if it is > 100 then it counts the total number of nodes in the tree and if the total is also > 100, it prevents an expand all and only expands two levels.

      There are several issues with this:

      1) This code is executed on every expand/collapse event and can be expensive. Counting 100 nodes in the RowKeySet and in the tree (see TableUtils._getSizeOfTree()) can force the model to do additional data fetches beyond what is currently displayed in the view port. Also the number 100 is completely arbitary.

      2) There is no way to for this code to know if the user did an "Expand All" or just did something to cause 100 nodes to expand. For example "Expand All Below", or just select 100 nodes and do "Expand" from a menu. In these cases the user will get unexpcted results (only two levels will expand)

      3) Preventing the user from doing an Expand All should really be part of application logic and has no place in the framework. Normally the application would display a warning and ask the user if they really want to do an expand all in response to a user action

      [Proposal]

      I would like to propose that this code be removed from UIXTree. I will submit a patch if there are no strong objections. This is a change in the Trinidad tree functionality, and I am not sure how it impacts current users.

      Attachments

        1. expandall.1.2.9.1.patch
          2 kB
          Kamran Kashanian
        2. expandall.trunk.1.2.x.patch
          2 kB
          Kamran Kashanian

        Activity

          People

            matzew Matthias Wessendorf
            kamrankashanian Kamran Kashanian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: