Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
show wait cursor for long running process
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
L Frohman  
View profile  
 More options Jul 30 2007, 1:02 pm
From: "L Frohman" <lfroh...@gmail.com>
Date: Mon, 30 Jul 2007 10:02:13 -0700
Local: Mon, Jul 30 2007 1:02 pm
Subject: show wait cursor for long running process
I have a long running process (5 seconds or more), and I want to show the
wait / hourglass
cursor, while the process runs. The code below works in IE, but not other
browsers. I couldn't find
anything in previous posts. Can anyone tell me what is wrong with the code?

=====================

public void showWait() {
    Element element = focusPanel.getElement();
    DOM.setStyleAttribute(element,"cursor","wait");
    focusPanel.setFocus(true);
    DOM.setCapture(element);

}

public void showUnwait() {
    Element element = focusPanel.getElement();
    DOM.releaseCapture(element);
    DOM.setStyleAttribute(element,"cursor","default");

}

(calling code)

 public void zoomin() {
    showWait();
    DeferredCommand.addCommand(new Command() {
        public void execute() {
            longRunningProcess();
            showUnwait();
        }
    });
 }


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
abickford  
View profile  
 More options Jul 30 2007, 5:03 pm
From: abickford <adam.bickf...@gmail.com>
Date: Mon, 30 Jul 2007 21:03:52 -0000
Local: Mon, Jul 30 2007 5:03 pm
Subject: Re: show wait cursor for long running process
You should probably do this by adding/removing CSS classes to the
elements and styling them as needed.

That being said, i think using "pointer" and "normal" instead of
"wait" and "default" will work as well.

On Jul 30, 1:02 pm, "L Frohman" <lfroh...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Reinier Zwitserloot  
View profile  
 More options Jul 30 2007, 6:52 pm
From: Reinier Zwitserloot <reini...@gmail.com>
Date: Mon, 30 Jul 2007 15:52:39 -0700
Local: Mon, Jul 30 2007 6:52 pm
Subject: Re: show wait cursor for long running process
Do NOT use CSS in case of doubt - direct setting of the DOM is far
less likely to have unwanted side effects, such as not working
properly.

'pointer' is something very very different from wait.

Try setting the cursor directly on the body tag:

DOM.setStyleAttribute(RootPanel.get().getElement(), "cursor", "wait");

If that also doesn't work, could be this just can't be done.

On Jul 30, 11:03 pm, abickford <adam.bickf...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
L Frohman  
View profile  
 More options Jul 30 2007, 7:08 pm
From: "L Frohman" <lfroh...@gmail.com>
Date: Mon, 30 Jul 2007 16:08:36 -0700
Local: Mon, Jul 30 2007 7:08 pm
Subject: Re: show wait cursor for long running process
Thanks, but

DOM.setStyleAttribute(RootPanel.get().getElement(), "cursor", "wait");

didn't help - still works in IE, not in Firefox/Safari.

"could be this just can't be done" - too bad.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dean S. Jones  
View profile  
 More options Jul 30 2007, 11:49 pm
From: "Dean S. Jones" <deansjo...@gmail.com>
Date: Tue, 31 Jul 2007 03:49:34 -0000
Local: Mon, Jul 30 2007 11:49 pm
Subject: Re: show wait cursor for long running process
I think it's a pretty well known "browser quirk" that changing the
cursor
while in some JavaScript action/event will not take effect until you
MOVE the cursor after setting it...

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dean S. Jones  
View profile  
 More options Jul 31 2007, 12:29 am
From: "Dean S. Jones" <deansjo...@gmail.com>
Date: Tue, 31 Jul 2007 04:29:12 -0000
Local: Tues, Jul 31 2007 12:29 am
Subject: Re: show wait cursor for long running process
Using the following code, the behavior seems correct for IE 6 and
Firefox 2.0.0.3, using gwt 1.4.10, Safari you have to MOVE the cursor,
as I posted above,
Opera 9.22 is even more bizarre, you have to move the cursor over
another element that has a cursor defined, and back out into the body
again. Note that
if you don't move the cursor FROM over an element that may have a
cursor defined ( like the button that triggered it ) you will not see
the cursor change in
IE or Firefox.

                final Button b = new Button("Test");

                b.addClickListener(new ClickListener()
                {
                        public void onClick(Widget sender)
                        {
                                Timer t = new Timer()
                                {
                                        public void run()
                                        {
                                                DOM.setStyleAttribute(RootPanel.get().getElement(), "cursor",
"wait");
                                        }
                                };
                                t.schedule(5000);

                                t = new Timer()
                                {
                                        public void run()
                                        {
                                                DOM.setStyleAttribute(RootPanel.get().getElement(), "cursor",
"pointer");
                                        }
                                };
                                t.schedule(10000);

                                t = new Timer()
                                {
                                        public void run()
                                        {
                                                DOM.setStyleAttribute(RootPanel.get().getElement(), "cursor",
"wait");
                                        }
                                };
                                t.schedule(15000);

                                t = new Timer()
                                {
                                        public void run()
                                        {
                                                DOM.setStyleAttribute(RootPanel.get().getElement(), "cursor",
"pointer");
                                        }
                                };
                                t.schedule(20000);
                        }
                });
                this.add(b);


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Blazejewicz  
View profile  
 More options Jul 31 2007, 5:44 am
From: Peter Blazejewicz <peter.blazejew...@gmail.com>
Date: Tue, 31 Jul 2007 02:44:14 -0700
Local: Tues, Jul 31 2007 5:44 am
Subject: Re: show wait cursor for long running process
Hi,
as Dean noted I think we should follow ajax patterns:
http://ajaxpatterns.org/Progress_Indicator
also (from linked page):
<quote>
Note that one form of indicator to avoid is changing the cursor. Many
traditional GUIs switch over to a "rotating hourglass" or related icon
during delays. That's probably inappropriate for Ajax, because it's
something the browser software will often do, e.g. while loading a new
page, so it's likely to create confusion.
</quote>

hth,
regards,
Piotr

On Jul 31, 5:49 am, "Dean S. Jones" <deansjo...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »