Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2236

It should be possible to determine when there are active Ajax requests

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.4
    • Fix Version/s: 5.4
    • Component/s: tapestry-core
    • Labels:

      Description

      Often, for testing, it is necessary to know when an Ajax request has completed. This is currently accomplished via sleeps and such (in Tapestry's built-in test suite). For Ajax requests via the t5/core/dom:ajaxRequest API, Tapestry can track how many Ajax requests are active, and set an attribute on the body element to indicate if there are any active requests.

      The body attribute "data-ajax-active" will be "true" when there is at least one Ajax request and will revert to "false" when all requests have completed succesfully, or failed with an error or exception.

      This is similar to the "data-page-initialized" attribute; it is on the body element to make it easier to query it using CSS.

        Attachments

          Activity

            People

            • Assignee:
              hlship Howard M. Lewis Ship
              Reporter:
              hlship Howard M. Lewis Ship
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: