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

tree: incorrect scroll position, after model replace (renders incomplete)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.6.0
    • 8.5.1, 9.5.0.2
    • Components
    • Security Level: Jimmy

      Steps to Reproduce

      run the simplified attached example tree-remains-empty-zk4804.zul
      or this zkfiddle

      scroll to about half the height (around item 4000)

      click "remove TreeModel" (sets model to null)
      click "add TreeModel"

      Current Result

      tree fails to render contents correctly (not always, seems timing dependent)
      the tree remains at the current scroll position (even after clearing the model)

      Expected Result

      when the model is set to null, the scroll position should to reset to top

      Debug Information

      even calling tree.invalidate() after clearing and adding a tree model fixes the issue.

      Workaround

      call the private method tree.resetPosition(false) via reflection

            rudyhuang rudyhuang
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Time Spent - 4 hours Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - 4 hours Remaining Estimate - 4 hours
                4h