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

AJAX commands execute before Initial page response

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Normal
    • 9.0.0
    • 8.5.1.2
    • ZK Client Engine
    • Security Level: Jimmy
    • None
    • fast network connection, e.g. localhost

    • ZK 8.6.0 S1, ZK 8.6.0 S2, ZK 9.0.0 S1

    Description

      Steps to Reproduce

      <zk>
      	<window id="outer"
      			onCreate='Clients.showBusy(outer, "Outer Busy");'
      			onClientInfo="Clients.clearBusy(outer)" width="500px" height="500px">
      		Content
      	</window>
      </zk>
      

      Current Result

      busy message remains on screen

      Expected Result

      busy message gets cleared

      Debug Info

      clearBusy gets called before showBusy if the onClientInfo event responds very quickly (e.g. after 10ms on localhost)

      Root Cause

      there is a 25ms interval delaying the commands of the initial page response

      https://github.com/zkoss/zk/blob/849c3d175aa13fef38a9ccf77b93dc60545e30c5/zk/src/archive/web/js/zk/mount.js#L83-L102

      Workaround

      call showBusy earlier during widget creation

      	<window id="outer"
      			w:onBind="zAu.cmd0.showBusy(this, 'Outer Busy')"
      			onClientInfo="Clients.clearBusy(outer)" width="500px" height="500px">
      		Content
      	</window>
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1 day Original Estimate - 1 day
                  1d
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 30 minutes
                  1d 30m