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

AJAX commands execute before Initial page response

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal 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
    • None

      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>
      

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

              Created:
              Updated:
              Resolved:

                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