473,789 Members | 2,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying a modal "busy" dialog while sorting a table

Hi,

I have 2 javascript functions, one that sorts a table and one that
shows/hides a modal dialog that displays something like "Sorting" with
a little icon indicating that the browser is "busy" and you need to
wait. This is done because on larger tables the sort routine can take
upwards of 10 seconds. I try the following code:

<th onclick="showMo dal(); sort(this); hideModal();">s ome header</th>

but unfortunately the modal code is never displayed. If I throw in an
alert, it will display properly, but this seems to be a timing/
redrawing issue. This app only has to work for IE, but I'd like it to
work across all browsers. I tried throwing in a couple setTimeOut's
in there, but no luck so far, I even tried to simulate clicks on
different hidden form elements which would cause the panels to be
shown/hidden and even sorting, but all with no luck. Has anyone
encountered anything similar to this and gotten it to work? Any help
is appreciated!

Thanks!
Feb 14 '08 #1
3 3045
On Feb 14, 4:03 pm, froste...@gmail .com wrote:
Hi,

I have 2 javascript functions, one that sorts a table and one that
shows/hides a modal dialog that displays something like "Sorting" with
a little icon indicating that the browser is "busy" and you need to
wait. This is done because on larger tables the sort routine can take
upwards of 10 seconds. I try the following code:

<th onclick="showMo dal(); sort(this); hideModal();">s ome header</th>

but unfortunately the modal code is never displayed. If I throw in an
alert, it will display properly, but this seems to be a timing/
redrawing issue. This app only has to work for IE, but I'd like it to
work across all browsers. I tried throwing in a couple setTimeOut's
in there, but no luck so far, I even tried to simulate clicks on
different hidden form elements which would cause the panels to be
shown/hidden and even sorting, but all with no luck. Has anyone
encountered anything similar to this and gotten it to work? Any help
is appreciated!

Thanks!
What is in your showModal()?
The code would be more helpful than a description...
Feb 14 '08 #2
On Thu, 14 Feb 2008 08:03:25 -0800, frosted74 wrote:
Hi,

I have 2 javascript functions, one that sorts a table and one that
shows/hides a modal dialog that displays something like "Sorting" with a
little icon indicating that the browser is "busy" and you need to wait.
This is done because on larger tables the sort routine can take upwards
of 10 seconds. I try the following code:

<th onclick="showMo dal(); sort(this); hideModal();">s ome header</th>

but unfortunately the modal code is never displayed. If I throw in an
alert, it will display properly, but this seems to be a timing/
redrawing issue. This app only has to work for IE, but I'd like it to
work across all browsers. I tried throwing in a couple setTimeOut's in
there, but no luck so far, I even tried to simulate clicks on different
hidden form elements which would cause the panels to be shown/hidden and
even sorting, but all with no luck. Has anyone encountered anything
similar to this and gotten it to work? Any help is appreciated!

Thanks!
I've run into this before, browsers not updating the screen until after
the Javascript has finished.

call a function that:
updates your screen
sets a timout to call the sort function (minimal delay)

Then your sort function finishes and hides the busy message.

(I don't know what sort algorithm you are using, but a couple of them can
[semi] easily be modified to run in 'spurts' on a timeout. This would
keep things from appearing locked up.)
Feb 14 '08 #3
On Feb 14, 12:13 pm, GArlington <garling...@tis cali.co.ukwrote :
On Feb 14, 4:03 pm, froste...@gmail .com wrote:
Hi,
I have 2 javascript functions, one that sorts a table and one that
shows/hides a modal dialog that displays something like "Sorting" with
a little icon indicating that the browser is "busy" and you need to
wait. This is done because on larger tables the sort routine can take
upwards of 10 seconds. I try the following code:
<th onclick="showMo dal(); sort(this); hideModal();">s ome header</th>
but unfortunately the modal code is never displayed. If I throw in an
alert, it will display properly, but this seems to be a timing/
redrawing issue. This app only has to work for IE, but I'd like it to
work across all browsers. I tried throwing in a couple setTimeOut's
in there, but no luck so far, I even tried to simulate clicks on
different hidden form elements which would cause the panels to be
shown/hidden and even sorting, but all with no luck. Has anyone
encountered anything similar to this and gotten it to work? Any help
is appreciated!
Thanks!

What is in your showModal()?
The code would be more helpful than a description...
The showModal() called a function of RichFaces, which is a JSF-API
from Exadel. The method itself is really inconsequential , it works on
its own, it's just when called in combination with the other functions
it ceases to work properly. The solution presented by Jeremy works,
thanks! I am wondering though, is there some instances where
setTimeout will not work properly if the client is on a slower
machine? I am concerned because the "modal" window popping up
prevents the user from any other interaction on the page, and the end
of my method removes that window and resumes normal operation. I
guess I'm just worried about that 'window' being stuck on the screen.
Right now I am using a 20ms timeout, have you found a sweet spot for a
timeout?

Thanks again, your help is appreciated!
Feb 14 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
16958
by: Ken Varn | last post by:
Sometimes when I try to close my managed C++ application, the following dialog displays in Win 2000 Pro: The title of the dialog is "Server Busy". The message is "This action cannot be completed because the other program is busy. Choose 'Switch to' to activate the busy program and correct the problem." I don't know why this is displayed. I would prefer to disable the display of this message if possible. My app needs to be able to...
1
3021
by: Philipp Lenssen | last post by:
Using Firefox and this Reversi script http://gamesforthebrain.com/game/reversi/ , I often get "A script on this page may be busy ..." warning message. I suspect to be the recursive min-max algorithm which takes too long in "Medium" mode -- it never happens in "Easy" mode. Is there anything I may try tweaking in the JS so users won't see this somewhat annoying message?
1
1693
by: placid | last post by:
Hi all, Just wondering if the cmd module in python uses "busy waiting" for "polling" user command input as this is inefficient. Cheers
0
1372
by: VB Programmer | last post by:
I keep getting the "Microsoft Visual Studio is busy" message. Is there any way to tell WHY this is hanging up? I almost always have to just kill the task.
4
7871
by: Gary Brown | last post by:
Hi and Happy Holidays, VS 2005 yields "Microsoft Visual Studio Is Busy Microsoft Visual Studio is waiting for an internal operation to comple. If you ... report this problem to Microsoft." I'm not sure if this constitutes reporting it to MS but here it is.
7
5077
by: DC | last post by:
Hi, there is a 500;13 page one can configure in the website properties, but ..Net Framework 1.1 also delivers the "server too busy" message sometimes and the IIS custom error page does not seem to catch that. How would I customize the error page then? Regards DC
0
10410
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5418
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.