Executing Scripts Across Multiple Screens

This is the knowledgebase for Genie, all resolved support and product questions are located here. Please search this forum before posting any new support and technical questions.
Locked
Profound Logic
Site Admin
Posts: 252
Joined: Fri Dec 14, 2007 1:09 pm
Contact:

Executing Scripts Across Multiple Screens

Post 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.
Locked

Who is online

Users browsing this forum: No registered users and 0 guests