473,320 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Popup Window Popup Timing

Hi,
I am using a popup window in my application and the problem I'm having is
that even though I tell it to display before a while loop, it only displays
after the while loop completes. Please take a look at the code below. Is
there a way to get it to pop up before the while loop starts?

p=window.createPopup();
var pbody=p.document.body;
pbody.style.backgroundColor="white";
pbody.style.border="solid black 2px";
pbody.innerHTML="All containers on same File/DO will be automatically
selected. Please wait for this window to close.";
p.show(150,150,200,90,document.body);
while (i<len)
{
...this while loop takes about 7 seconds to complete...
}

Thanks,
John

Nov 19 '05 #1
3 1612
the browser is a standard windows app. a window will not appear until the
main thread (also the one client script is running in) calls the window loop
(doevents).

the workaround is simple, break you code into 2 parts and use
window.setTimeout (which uses a standard windows event) to run the second
part after a windows loop has been run.

p=window.createPopup();
var pbody=p.document.body;
pbody.style.backgroundColor="white";
pbody.style.border="solid black 2px";
pbody.innerHTML="All containers on same File/DO will be automatically
selected.
Please wait for this window to close.";
p.show(150,150,200,90,document.body);
window.setTimeout('doWork()',1);
}

function doWork()
{
while (i<len)
{
...this while loop takes about 7 seconds to complete...
}
}

-- bruce (sqlwork.com)
"John Walker" <Jo********@discussions.microsoft.com> wrote in message
news:4C**********************************@microsof t.com...
Hi,
I am using a popup window in my application and the problem I'm having is
that even though I tell it to display before a while loop, it only
displays
after the while loop completes. Please take a look at the code below. Is
there a way to get it to pop up before the while loop starts?

p=window.createPopup();
var pbody=p.document.body;
pbody.style.backgroundColor="white";
pbody.style.border="solid black 2px";
pbody.innerHTML="All containers on same File/DO will be automatically
selected. Please wait for this window to close.";
p.show(150,150,200,90,document.body);
while (i<len)
{
...this while loop takes about 7 seconds to complete...
}

Thanks,
John

Nov 19 '05 #2

"John Walker" <Jo********@discussions.microsoft.com> wrote in message
news:4C**********************************@microsof t.com...
Hi,
I am using a popup window in my application and the problem I'm having is
that even though I tell it to display before a while loop, it only
displays
after the while loop completes. Please take a look at the code below. Is
there a way to get it to pop up before the while loop starts?

p=window.createPopup();
var pbody=p.document.body;
pbody.style.backgroundColor="white";
pbody.style.border="solid black 2px";
pbody.innerHTML="All containers on same File/DO will be automatically
selected. Please wait for this window to close.";
p.show(150,150,200,90,document.body);
while (i<len)
{
...this while loop takes about 7 seconds to complete...
}

Thanks,
John


You can split the function into two functions and run them with a third
function. The key is to start the loop with a little delay.
-------------------------------------------------
function ShowMessage(){
p=window.createPopup();
var pbody=p.document.body;
pbody.style.backgroundColor="white";
pbody.style.border="solid black 2px";
pbody.innerHTML="All containers on same File/DO will be automatically
selected. Please wait for this window to close.";
p.show(150,150,200,90,document.body);
}

function StartLoop(){
while (i<len)
{
...this while loop takes about 7 seconds to complete...
}
}

function StartItAll(){
ShowMessage();
setTimeout("RunLoop()", 10);
}

--------------------------
Marius
Nov 19 '05 #3
Bruce,
Been having a bad day, but this worked and feel a little better. Thanks.

"Bruce Barker" wrote:
the browser is a standard windows app. a window will not appear until the
main thread (also the one client script is running in) calls the window loop
(doevents).

the workaround is simple, break you code into 2 parts and use
window.setTimeout (which uses a standard windows event) to run the second
part after a windows loop has been run.

p=window.createPopup();
var pbody=p.document.body;
pbody.style.backgroundColor="white";
pbody.style.border="solid black 2px";
pbody.innerHTML="All containers on same File/DO will be automatically
selected.
Please wait for this window to close.";
p.show(150,150,200,90,document.body);
window.setTimeout('doWork()',1);
}

function doWork()
{
while (i<len)
{
...this while loop takes about 7 seconds to complete...
}
}

-- bruce (sqlwork.com)
"John Walker" <Jo********@discussions.microsoft.com> wrote in message
news:4C**********************************@microsof t.com...
Hi,
I am using a popup window in my application and the problem I'm having is
that even though I tell it to display before a while loop, it only
displays
after the while loop completes. Please take a look at the code below. Is
there a way to get it to pop up before the while loop starts?

p=window.createPopup();
var pbody=p.document.body;
pbody.style.backgroundColor="white";
pbody.style.border="solid black 2px";
pbody.innerHTML="All containers on same File/DO will be automatically
selected. Please wait for this window to close.";
p.show(150,150,200,90,document.body);
while (i<len)
{
...this while loop takes about 7 seconds to complete...
}

Thanks,
John


Nov 19 '05 #4

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

Similar topics

2
by: Xenophobe | last post by:
I have a popup window (required by the client) containing a form and would like to prevent users from accessing it directly. They are instead required to access the page via a hyperlink on another...
1
by: Noozer | last post by:
When using the WebBrowser control, is it possible to cause popup windows to appear within the WebBrowser control itself instead of a new window? This is what I've written in the NewWindow2 event,...
38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
4
by: Flex | last post by:
Hi everybody, what's the code for a form submission in a new window? i wasn't sure it it should go in the form action tag, or in the submit button. I tried something like this: <form ...
4
by: Davey | last post by:
I have a website which has a popup window (this only opens when the user chooses to open it). In the popup window I have a <select> control which lists a selection of "classes". Each class has a...
6
by: Kenneth | last post by:
Hi, function NewWindow(mypage, myname, w, h, scroll) { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; winprops =...
0
by: ChrisB | last post by:
I'm attempting to open a new window from a LinkButton in a DataGrid. I can set a session variable in the ItemCommand event for the LinkButton like so: // this is used to handle the ItemCommand...
7
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses...
3
by: Jimmy | last post by:
It is also possible for popup window to call function in main window by using the opener property. Will "opener.someFunctionInMain(param1, param2)" in the popup window work? It's possible for...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.