Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3738

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

    Details

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

      Description

      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)

        Activity

        Hide
        Anonymous added a comment -

        Fixed since 2018/04/13

        Show
        Anonymous added a comment - Fixed since 2018/04/13

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

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