3 Replies Latest reply on Aug 18, 2008 2:54 PM by shadowcreeper

    Busy cursor for Ajax calls?

    lanceb185

      Hi

      Is it possible to set the cursor to the hour-glass cursor when an Ajax call is made? Currently, for example when a check box is toggled, which requires a visit to the server (via a4j:support), the cursor is not affected. I realise a4j:status can be used to indicate a status but ideally I would like to set the cursor while the round-trip is in process (as with Swing clients).

      Help much appreciated
      Lance

        • 1. Re: Busy cursor for Ajax calls?
          shadowcreeper

          Why not a style="cursor: wait;" on the status component?

          If it is a rich:modalPanel, this should work fine.

          Alternatively you could put in some javascript that adds waitCursor to the body tag's class on a4j:status start and removes it on stop...

          • 2. Re: Busy cursor for Ajax calls?
            lanceb185

            Can you illustrate with a short example? So if I have a large table with a submit button beneath, I'd like the cursor be set to wait state for the entire page. How do I best accomplish this with style="cursor: wait;"

            Thanks again

            • 3. Re: Busy cursor for Ajax calls?
              shadowcreeper

              Try something like this...

              function addMainBodyWaitClass ()
              {
               var bodyNode = document.getElementById( 'mainBody' );
               bodyNode.addClassName( 'waitClass' );
              }
              
              function removeMainBodyWaitClass ()
              {
               var bodyNode = document.getElementById( 'mainBody' );
               bodyNode.removeClassName( 'waitClass' );
              }
              


              PS - Removing a class that isn't on the element shouldn't hurt anything either.