Refresh Screen
-
- 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
How do you automatically refresh a screen in Genie? I need to hit the ENTER button every 5 minutes.
- 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
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):
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;
}
-
- 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
Thanks. That worked.
- 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
Wow. First try? Something must be wrong. :-).
Who is online
Users browsing this forum: No registered users and 1 guest