Wait

Deprecation Warning! The content below is only applicable for use within deprecated 1.x versions of CA Agile Central's App SDK. Use of the component(s) and/or code on this page is not supported. To develop custom apps within our current environments, please see App SDK 2.0 documentation.

The Wait component provides a way to give feedback that a long running operation is occurring. It is useful to display while a data query is taking place.

wait

Wait includes the following topics:

Create a wait

First include the App SDK JavaScript:

<script type="text/javascript" src="/apps/[version]/sdk.js"></script>

Instantiate a new wait:

var wait = new rally.sdk.ui.basic.Wait(config);

The parameters for rally.sdk.ui.basic.Wait are as follows:

Parameter Description Example
config* A configuration object. { hideTarget: false, text: "Loading..." }
  * = required parameter

The wait configuration object supports the following properties:

Parameter Description
hideTarget Whether the target display element is hidden
(default = true)
text The hover text to show (default = "Loading...")
  * = required parameter

Display a wait

Once created, use the display method to display the wait:

wait.display(domElement);

Parameter Description Example
domElement* The element in which to display the wait.
This may be either an element or an element ID.
"targetDiv", document.getElementById("targetDiv")
  * = required parameter

Public methods

Method Name Parameters Description Example
display See above - See above
hide - Remove the wait wait.hide();

Example

Copy and paste the following into a CA Agile Central custom app page.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- Copyright (c) 2002-2010 CA Agile Central Software Development Corp. All rights reserved. -->
<html>
   <head>
   <title>Busy Wait Example</title>
   <meta name="Name" content="App Example: Wait Spinner" />
   <meta name="Version" content="2010.4" />
   <meta name="Vendor" content="CA Agile Central Software" />

   <script type="text/javascript" src="/apps/1.26/sdk.js"></script>
   <script type="text/javascript">

     var waiter;

     function hideSpinner() {
       waiter.hide();
     }

     function showSpinner() {
       waiter = new rally.sdk.ui.basic.Wait({hideTarget: false});
       waiter.display("div1");

       setTimeout(hideSpinner, 3000);
     }

     rally.addOnLoad(showSpinner);
   </script>
   </head>
  <body>
     <div style="width:300px;height:300px;border: #000 1px dashed" id="div1"></div>
   </body>
</html>

Feedback

Need more help? The CA Agile Central Community is your one-stop shop for self-service and support. To submit feedback or cases to CA Agile Central Support, find answers, and collaborate with others, please join us in the CA Agile Central Community.