Skip to Content
avatar image
Former Member

Turning mouse cursor into Hourglass when executing lengthy iCommands

I have a pretty lengthy iCommand that's being executed in the background when an HTML button is clicked. The users would like to see the mouse cursor become an hourglass instead of seeing an alert pop up. My block of code looks something like this:

function executeQuery()

{

window.document.body.style.cursor = "wait"; // function used for cursor to become an hourglass

execute iCommands here......

.

.

.

window.open();

window.document.body.style.cursor = "default"; // cursor becomes a regular pointer again.

}

The only problem is that the cursor doesn't turn at all (although it does work fine WHEN the Page_Load Function is executed (and querying upon loading of the page), even when the iCommands are taken a couple minutes to query. Is there something that Im doing wrong?

Any feedback and/or help would be greatly appreciated! Thank you!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Aug 05, 2008 at 02:00 PM

    Or if feasible with your design, you could use an animated GIF.

    Now because the iCommand execution is taking sometime even the image kind of freezes , but in my experience , that is always a better visual approach to make the end user aware of query processing.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 05, 2008 at 02:59 AM

    Hi,

    Your problem is if iCommand applet is taking couple of minutes to execute, then this code is not working?

    If my understanding is right,then instead of calling this function on page load you need to call by using FirstUpdateEvent.

    This will ist check applet is loaded fully or not.If it is loaded then this code will be executed.If it is not loaded,then it will wait to load fully and then this code will be executed.

    Hope this will help you.

    Thanks,

    Manisha

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 05, 2008 at 03:51 AM

    Hi,

    To call the function by using FirstUpdateEvent :

    Define a global variable:

    var vApplet=0;

    function checkApplet()

    {

    vApplet = vApplet+1;

    if(vApplet ==1)

    {

    executeQuery();

    }

    else

    {

    }

    }

    checkApplet() will check your applet is loaded fully or not.

    If it is loaded fully, it will call executeQuery().

    function executeQuery()

    {

    window.document.body.style.cursor = "wait"; // function used for cursor to become an hourglass

    execute iCommands here......

    .

    .

    .

    window.open();

    window.document.body.style.cursor = "default"; // cursor becomes a regular pointer again.

    }

    Then call checkApplet() in your iCommand Applet like this:

    At the end of applet

    <PARAM NAME="FirstUpdateEvent" VALUE="checkApplet">

    Hope this will help you.

    Thanks,

    Manisha

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Jeremy Good

      I completely agree, Jeremy! Misleading suggestions can cause other users countless hours of wasted time and effort!

      On the topic of how to do this, I would highly recommend using an AJAX approach instead of the iCommand applet in this case. The first "A" in AJAX is "asynchronous", which allows the application developer to do any type of processing to handle the pending request. In this case, you could use the XmlHTTPRequest object to invoke either the Illuminator servlet or the Runner servlet, as needed.

      Rick