asna.com Sign In
HOW TO: Implement a splash screen in Monarch project 

SUMMARY

On the iSeries, one has the ability to WRITE to a workstation an output only record and continue processing.  This allowed the application to render the equivalent of a “splash screen” and when the process was finished; further WRITEs would replace the user’s view.

DETAILS

This technique has become problematic when it has been migrated to Monarch in that workstation records that are written by the application are marshaled until a READ is executed, where the assembled records are then directed to the browser.  Because there is no READ in the legacy code following the output only record, the user sees nothing.  However, adding a READ statement following the WRITE also becomes problematic in that the user must now press the <enter> key to affect the postback and also the resumption of logic execution.

RESOLUTION

The way to resurrect the splash screen behavior is to implement the following steps:

  1. Issue a READ following the WRITE to the workstation.  This forces Monarch to send the record to the browser.  The READ can be of the record just written or of the WorkStation file name.
  2. Instruct the browser to immediately postback as if the <enter> key were pressed.  This is accomplished with ECMA script (JavaScript) and Monarch’s built in ECMA script function called “pushKey”.  The script must be included in the response to the browser whenever the “splash” record is written.   The code below illustrates how this is done during the OnCopyDspFileToBrowser method in the code behind of the DisplayFile aspx (ASNA.Monarch.WebDspF.Page).   Note that the script is inserted only when the record called “MySplash” is being written.

 

MORE INFORMATION

More about ClientScript is available from System.Web.UI.Page class

More about the OnCopy… methods is available from ASNA.Moanrch.WebDspF.Page class.

More about pushKey() and related key press functions is available from Monarch Framework help.

Related Articles
Article Downloads
 
Keywords:
 
Article ID: 459 
Category: ASNA Visual RPG : Web Development; ASNA Monarch 
Applies To: Monarch Framework 
Article Date: 5/1/2008