Page 1 of 1
Can you simulate a "WRITE" of a display record format?
Posted: Mon Oct 02, 2017 11:18 am
by sruthfor
Our users have discovered that an informational "Splash" green screen is not showing up in Genie. It is a record format that is output via an RPG "WRITE" of the format. It's used to give the user feedback while a long running underlying processing is occurring. It will disappear when the underlying record format is displayed via EXFMT. I contacted support and they said it is impossible for Genie to detect anything other than an EXFMT, which I suspected, but is there a Genie customization with a javascript workaround you could think of to temporarily display a panel or something while the display is input inhibited?
Re: Can you simulate a "WRITE" of a display record format?
Posted: Mon Oct 02, 2017 4:22 pm
by SeanTyree
I have done this using the following approach.
On your "Splash" screen put a pui.click(); in the onload event.
When you EXFMT the splash screen it will display during the initial load of the data for the main screen.
Sean
Re: Can you simulate a "WRITE" of a display record format?
Posted: Wed Oct 04, 2017 4:59 pm
by Scott Klement
You can't do just a WRITE, because that's now how web applications work ;-) It's not possible for a web server to just arbitrarily send a screen to a web browser... it can only send a screen/page when the user requests it. (Imagine if any web server on the internet could pop-up a page in your browser without you asking... it'd be a mess!)
What you can do, as Sean quite correctly points out, is that you can write a display that would normally accept some input (or, at least, a press of the enter key) to the screen, and you can have JavaScript code that immediately submits the screen. (In that case, the JavaScript code does the work of pressing Enter for the user.)
In a Rich Display, you'd do that with pui.click(), like Sean said.
In a 5250 display, you'd use pressKey('ENTER').
You can do it in the onload event if you want it to happen immediately, or if you want to add a little bit of delay, you can run either pui.click() or pressKey with the JavaScript setTimeout API.