Page 1 of 1

Executing Scripts Across Multiple Screens

Posted: Wed Sep 10, 2008 9:29 am
by Profound Logic
Q: I would like to know how I can simulate a "silent screen navigation". What this is supposed to do (when a hyperlink is clicked):
  • Send the F10 Key to the iSeries;
    Wait for the next screen to load;
    Send a value (based on the hyperlink) to an input field;
    Send the Enter Key;

A: Once pressKey() is executed, the screen is submitted and any subsequent script commands do not take effect. However, Genie provides a few ways to execute scripts across multiple screens.

First, the pressKey() function accepts multiple parameters. For example:

pressKey("F10", "Enter");

This will press F10 on the first screen, and Enter on the next screen.

Secondly, for more complex operations, Genie provides a function called multiStepAction(), which allows you to pass script strings as multiple parameters or as an array. In your case, you can use this function as follows:

Code: Select all

function mandaOp(sndValue) {
  multiStepAction("pressKey('CF10')",
                  "changeElementValue('I_18_71', '" + sndValue + "');
                  pressKey('Enter');");
}
This executes your commands in two distinct steps on two different screens.