Refresh Screen

Use this board to ask questions or have discussions with other Genie users.
Post Reply
bernard602
New User
Posts: 5
Joined: Mon Mar 21, 2011 3:23 pm
First Name: Mike
Last Name: Bernard
Company Name: Acme Truck Line, Inc
Phone: 985.209.5568
Contact:

Refresh Screen

Post by bernard602 »

How do you automatically refresh a screen in Genie? I need to hit the ENTER button every 5 minutes.
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Refresh Screen

Post by David »

Hi Bernard.

For 1 particular screen?

This can be done using JavaScript timers:

https://developer.mozilla.org/en-US/doc ... ipt/Timers

Basically you'd want to use 'setTimeout()' from the 'onload' event of the screen, storing the return value. Then use the 'onsubmit' event to cancel the timer so that it doesn't fire after a normal screen submit. Something along these lines (untested):

Code: Select all


// In onload event: 

// Global variables are properties of 'window', so 'window.myTimer' in effect creates a global variable 'myTimer' on the page. Should really attach to a predefined object, maybe defined in 'custom.js'...

window.myTimer;
myTimer = setTimeout(function() {

  myTimer = null;
  pressKey("Enter");

}, 300000);

// In 'onsubmit' event: 
if (myTimer != null) {

  clearTimeout(myTimer);
  myTimer = null;

}

bernard602
New User
Posts: 5
Joined: Mon Mar 21, 2011 3:23 pm
First Name: Mike
Last Name: Bernard
Company Name: Acme Truck Line, Inc
Phone: 985.209.5568
Contact:

Re: Refresh Screen

Post by bernard602 »

Thanks. That worked.
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Refresh Screen

Post by David »

Wow. First try? Something must be wrong. :-).
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests