Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Refreshing screen while client-side script in process

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,54566
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Refreshing screen while client-side script in process
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
 Refreshing screen while client-side script in process - 12/19/2007 3:44:02 AM   
  haz33

 

Posts: 13
Score: 0
Joined: 12/19/2007
Status: offline
Hi, I am currently developing an application where the user edits a collection of rows in a table, each containing several fields (text boxes).

One of the functions I allow the user to perform is to "bulk-populate" a bunch of rows' data with the click of a button. For, say, ten or so fields, the user can enter in values for those fields into text boxes at the top of the screen. Then by clicking a button, the application will automatically fill ALL of the rows in the table with that same data.

The problem arises when there are a lot of rows. For example, if I want to bulk-populate 300 rows, with each row containing ten fields (text boxes), my client-side VBScript procedure has to update 3,000 text boxes.....obviously not a terribly quick process.

Anyways, when the button is clicked in this situation, the browser "hangs" while the procedure populates each and every text box behind the scenes. Eventually, it completes, but the process can take 30 seconds or even longer.

My question is this: Is there a way to refresh or flush the controls as they're being populated (keep in mind that this is a client-side subroutine)? I just want the user to recognize that the application is actually doing SOMETHING. Perhaps there's an even better solution that I haven't thought of yet. If anyone has any suggestions, I'd greatly appreciate it. Thanks!
 
 
Post #: 1
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 3:51:37 AM   
  ebgreen


Posts: 4972
Score: 31
Joined: 7/12/2005
Status: offline
I think I would have the script pop up an ie window with a progress bar while it is doing the update.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to haz33)
 
 
Post #: 2
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 3:57:58 AM   
  haz33

 

Posts: 13
Score: 0
Joined: 12/19/2007
Status: offline
That's a good idea. But that leads to another question.

If it's a progress bar, I'd need to keep updating it every time I updated a row in my table. And since the progress bar would be in a completely separate IE window, how would I constantly update the progress bar's value from the original application's window?

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 4:02:45 AM   
  ebgreen


Posts: 4972
Score: 31
Joined: 7/12/2005
Status: offline
There are lots of examples of IE progress bars that don't need you to do anything to update them. You can use one that you control the updates for (there are lots of examples of those too).

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to haz33)
 
 
Post #: 4
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 4:11:24 AM   
  haz33

 

Posts: 13
Score: 0
Joined: 12/19/2007
Status: offline
Can you point me in the general direction of where I could find code for a progress bar that I wouldn't have to update?

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 4:15:56 AM   
  ebgreen


Posts: 4972
Score: 31
Joined: 7/12/2005
Status: offline
Sure. I would look here:

http://www.visualbasicscript.com/search.aspx

and here:

http://www.google.com

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to haz33)
 
 
Post #: 6
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 4:27:36 AM   
  haz33

 

Posts: 13
Score: 0
Joined: 12/19/2007
Status: offline
I'm wondering if you could clarify one of your previous statements. When you said that there are IE progress bars that don't need you to do anything to update them, for those situations, where does the progress bar get its values from?

For example, say I have 3,000 fields to update and I have a FOR loop that runs through and updates each one at a time. Obviously, you'd want to increment a counter each time you updated a field and send that value to the progress bar. But if you're not doing anything to update the progress bar, how does the progress bar know how close you are to completing the procedure?

(in reply to ebgreen)
 
 
Post #: 7
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 4:32:58 AM   
  ebgreen


Posts: 4972
Score: 31
Joined: 7/12/2005
Status: offline
Aaah, the ones that you don't update are really faux progress bars. They are the kind that just have some blob move from one side to the other repeatedly (I'm sure you've seen this before). They exist just to let the user know that something is happening not necessarily accurately indicate how much is going to happen or how much has already happened.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to haz33)
 
 
Post #: 8
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 4:48:21 AM   
  haz33

 

Posts: 13
Score: 0
Joined: 12/19/2007
Status: offline
Most of the client-side scripting examples I come across utilize WScript....which I supposedly can't because I'm running this code in an .aspx file in a web browser.

When do you want to use WScript and how does one use it?


(in reply to ebgreen)
 
 
Post #: 9
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 4:52:28 AM   
  ebgreen


Posts: 4972
Score: 31
Joined: 7/12/2005
Status: offline
Oh, the rows are being updated with server side code? In that case I think a Faux progress bar kicked off by the client page would be your only option. It is entirely possible that I am wrong however since I don't do web/server side scripting.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to haz33)
 
 
Post #: 10
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 4:57:22 AM   
  haz33

 

Posts: 13
Score: 0
Joined: 12/19/2007
Status: offline
Nope, they're not being updated with server side code. All client stuff. Maybe I'm misunderstanding how folks are using WScript.

(in reply to ebgreen)
 
 
Post #: 11
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 5:06:48 AM   
  ebgreen


Posts: 4972
Score: 31
Joined: 7/12/2005
Status: offline
Here is a progress bar that came from the Post a Script section of this site:


      


Give it a try and see if it will work for you.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to haz33)
 
 
Post #: 12
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 5:36:42 AM   
  haz33

 

Posts: 13
Score: 0
Joined: 12/19/2007
Status: offline
Thanks! I'll give it a shot.

(in reply to ebgreen)
 
 
Post #: 13
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 6:26:48 AM   
  TNO


Posts: 1247
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
Here's one I did from about a year ago:

http://www.visualbasicscript.com/m_41561/tm.htm

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to haz33)
 
 
Post #: 14
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 8:32:37 AM   
  haz33

 

Posts: 13
Score: 0
Joined: 12/19/2007
Status: offline
TNO:

Awesome! Exactly what I was looking for! Thanks for the help!

(in reply to TNO)
 
 
Post #: 15
 
 RE: Refreshing screen while client-side script in process - 12/19/2007 10:25:31 AM   
  Fredledingue


Posts: 383
Score: 0
Joined: 5/9/2005
From:
Status: offline
IMO, instead of populating all the fields one by one, it would be faster (lasting maybe a 1/4 of a second instead of half a minute) to load the html code into a string variable, operating a string replacement to insert the new default value, then replace the html code inside the form.
UserStr being the data to be duplicated among all the input boxes.

MyFormHtml = Replace(document.form.innerHtml, "value=""""", "value=""" & UserStr & """""")
document.form.innerHtml = MyFormHtml

or even shorter:

document.form.innerHtml = Replace(document.form.innerHtml, "value=""""", "value=""" & UserStr & """""")
 
Make sure that value=""" is present in the original code, eg:
<input type="text" name="Mydata" size="10"  value="">
otherwise it won't find the string to replace.

< Message edited by Fredledingue -- 12/19/2007 10:28:01 AM >


_____________________________

Fred

(in reply to haz33)
 
 
Post #: 16
 
 RE: Refreshing screen while client-side script in process - 12/20/2007 1:19:00 AM   
  haz33

 

Posts: 13
Score: 0
Joined: 12/19/2007
Status: offline
Good idea, but it won't work in my situation. The user is able to edit each individual text box as well. So the text for any particular text box is not necessarily blank.....in fact, it could be anything. On top of that, the user also has the choice of editing an explicit range of rows in the table.

Thanks for the idea though!

(in reply to Fredledingue)
 
 
Post #: 17
 
 RE: Refreshing screen while client-side script in process - 12/20/2007 3:36:12 AM   
  haz33

 

Posts: 13
Score: 0
Joined: 12/19/2007
Status: offline
TNO:

Another question for you. I like your code but I noticed that if you close out the progress bar window prematurely, it raises an error. How can you get around this? Can you suppress the close button on the window? Or better yet, can you eliminate the border on the progress bar window alltogether?

(in reply to TNO)
 
 
Post #: 18
 
 RE: Refreshing screen while client-side script in process - 12/20/2007 8:52:32 AM   
  TNO


Posts: 1247
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
showModelessDialog("progress.html",self,"dialogHeight: 200px; dialogWidth: 400px; edge: Raised; center: Yes; help: No; resizable: No; status: No; unadorned: yes;");

MAKE SURE PROGRESS.HTML CAN CLOSE ITSELF

or add a close button to the program manually.  Remember, this will only work if you program is run from a trusted html page, or an HTA

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to haz33)
 
 
Post #: 19
 
 RE: Refreshing screen while client-side script in process - 12/20/2007 9:01:09 AM   
  haz33

 

Posts: 13
Score: 0
Joined: 12/19/2007
Status: offline
I tried the UNADORNED parameter and it didn't work. The page that uses the progress.html is an .aspx page. My guess is that my page is not "trusted." How can you make it that way?

(in reply to TNO)
 
 
Post #: 20
 
 
Page:   [1] 2   next >   >>
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Refreshing screen while client-side script in process Page: [1] 2   next >   >>
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts