Page 1 of 1

F5 Handling, especially in RAMP applications

Posted: Wed Jun 06, 2018 9:44 am
by MarkD
Using F5 in a single page application like VLF-ONE will by default cause the web page to be refreshed.
This blows away the current VLF-ONE application, causing it to restart.

In non-RAMP applications this is not that much of a problem because users are not inclined to use F5, other than by accident.

However, in RAMP applications it may be more of a problem because F5 may be widely used in 5250 screen interactions. If the focus is not on the 5250 screen when the user presses F5, the keystroke gets directed out to the outer container, which can blow away the VLF-ONE application.

The solution seems to be to trap and ignore the F5 key, which can be done like this.

In the avMAINWindowReady method of your framework’s IIP enroll F5 as a shortcut:

Code: Select all

#USYSTEM.MainVLFPanel.EnrollShortCut Shortcut(F5) Logicaloperation(IGNORE)
Add a #USYSTEM.RequestShortCut event handler ....

Code: Select all

Evtroutine Handling(#USYSTEM.RequestShortCut) Logicaloperation(#LogicalOperation)
Case (#LogicalOperation)
When (= IGNORE)
* Do nothing
* Do something 
If you look at the shipped DF_OSYSTM you can see other short cut handling examples, like how to turn tracing off and on.

There may be other browser keys that you want to ignore this way, although it appears not all are trappable.