Tree SelectEvent.getSelectedObjects() inconsistent with TreeModel.getSelection()

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Normal
    • 8.5.2
    • Affects Version/s: 8.0.5
    • Component/s: Components
    • Security Level: Jimmy
    • None
    • None

      Steps to Reproduce

      http://zkfiddle.org/sample/3djug99/7-Hidden-selected-tree-nodes-ignored-in-onSelect
      1. click "select all"
      2. unselect any level 1 node (e.g. "2")
      3. observe the logs

      Current Result

      previous: [1.1, 1.2, 1, 2.1, 2.2, 2.3, 2, 3.1, 3]
      current from event: [3, 1]
      unselected from event: [2]
      current from model: [1.1, 1.2, 1, 2.1, 2.2, 2.3, 3.1, 3]
      

      Expected Result

      previous: [1.1, 1.2, 1, 2.1, 2.2, 2.3, 2, 3.1, 3]
      current from event: [1.1, 2.3, 2.2, 2.1, 1.2, 3.1, 3, 1]
      unselected from event: [2]
      current from model: [1.1, 1.2, 1, 2.1, 2.2, 2.3, 3.1, 3]
      

      Debug Info

      getSelectedObjects returns objects based on the currently rendered treeitems
      getPreviousSelectedObjects returns objects based on the actual model

      this is inconsistent and confusing

      Workaround

      instead of calling selectEvent.getSelectedObjects() call treeModel.getSelection() (which is synchronized correctly)

            Assignee:
            klyvechen
            Reporter:
            cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 2 minutes
                2m
                Remaining:
                Remaining Estimate - 2 minutes
                2m
                Logged:
                Time Spent - Not Specified
                Not Specified