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

Calling Clients.scrollIntoView(null) shows a error message

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 7.0.6
    • 7.0.6
    • None
    • Security Level: Jimmy
    • None
    • ZK 7.0.7

      Steps to reproduce

      1. call Clients.scrollIntoView(null) in an onClick listener under 7.0.6.FL.20150708-Eval
        or pass a detached component to Clients.scrollIntoView()

      Actual result

      An error message dialog show:

      Failed to process
      scrollIntoView
      Cannot read property 'uuid' of undefined (TypeError)

      This issue doesn't happen in 7.0.5 and 7.0.4

      Extra Information

      • Passing a null or detached component to scrollIntoView() can be treated as an invalid case. Showing error message can express it's invalid more explicitly. But maybe javascript error is hard to understand. We can consider throwing an exception in Java with explicit message like Cannot scroll to a null or detached component or more general one Component is null or detached.
      • Another use case is: when calling scrollIntoView(myComp), myComp is not null and not detached, myComp is detached in later program. In such case, checking the parameter doesn't take effect.

            ChunfuChang ChunfuChang
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h