pui.genie.onalarm (Genie)



The pui.genie.onalarm event fires after Genie has finished loading and displaying a 5250 screen where the ALARM 5250 keyword has been specified.  Customers can use this event to play a sound file or to provide some visual indication that the 5250 ALARM has been triggered.

This feature requires Profound UI 6 fix pack 2.0 or newer.

For example, the following may be placed in your Genie skin's custom.js file:

pui.genie.onalarm = function() { var soundFile = new Audio("/profoundui/userdata/sounds/ding.mp3"); soundFile.play(); }

Each time a 5250 ALARM is sent, this event will fire, and cause the above code to play the ding.mp3 file (which would need to be located in the appropriate place in your IFS).

This example uses HTML5's built-in ability to play an audio file. Playing audio is a feature of the browser, and support may vary depending on the browser and version that you use.  Wikipedia has a chart that shows what types of sound files work with different browsers.

Since this is a JavaScript event, you are not limited to merely playing audio files.  For example, in a loud area, or in an application that will be used by a deaf person, a sound file might not be ideal.  A better solution might be to provide a visual indication of the alarm on the screen.  For example, you could use JavaScript's built-in alert() function to pop-up a box that the user can see on the screen:

pui.genie.onalarm = function() { alert("alarm sounded"); }