Lets see..
IF you have an screen like this where pressing F4 in the Department field shows you a popup:
Code: Select all
REQ01 Popup 4/19/23 12:09:51
Department..... ADM
........................................
: Departments :
: :
: Code Description :
: ADM ADMINISTRATOR DEPT :
: MIS MANAGEMNT INFORMATIO + :
: :
: F1=Help F14=Messages :
:......................................:
F1=Help F3=Exit F4=Prompt F12=Cancel F14=Messages
and once you select something, you want to send an enter key, to show the result:
Code: Select all
DSP01 Popup 4/19/23 12:11:25
Department..... ADM
Description.... ADMINISTRATOR DEPT
Surname Given name(s)
JONES BEN
MCCULLY DAVID
ROBINSON MARY
SMYTHE JOHN
SMITHSON PAUL +
F1=Help F3=Exit F4=Prompt F12=Cancel F14=Messages
I would prefer to replace that input field with a dropdown. But, if you need to show
a popup, in my example this is just a list of departments, but maybe in yours that input
value is something that shows different other subsequent options in the popup.
I will begin identifying both screens, let's say.
REQ01 by the name of the screen (REQ01 in my case)
and the popup screen by the title Departments.
Then, I'll bring a multitype input to the input field for department in the screen
and put a code like this here to force the F4 popup to be displayed as soon as I complete
x number of characters in that field for example:
Code: Select all
sessionStorage.setItem('callingPopup',0);
if (FIELD.getValue().length == 3)
{
sessionStorage.setItem('callingPopup',1);
SENDKEY("F4");
}

- r419axes01.png (121.64 KiB) Viewed 4757 times
then in the same screen, on arrive:
Code: Select all
if ( sessionStorage.getItem('callingPopup') == 1)
{
sessionStorage.setItem('callingPopup',0);
SENDKEY("Enter");
}

- r419axes02.png (109.31 KiB) Viewed 4755 times
the reason to define both screens, even when I did nothing in the second one, the one with
the popup and Description in the title, is to not mixup both screens, that would cause the onArrive
for the Screen to be triggered incorrectly.
sessionStorage is a way to pass values, there are others as well.