Skip to Content

Screen Personas - Event that fires after F4 help selection

Is there a way to do some script action after a F4 help value was selected?
In many usecases you have to select a value with the F4 search help and then continue to the next screen with a button or the Enter Vkey.
I will implement this in one step.


With the onAfterRefresh - event it does not work properly.

Best regards

Thomas

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 30 at 10:00 PM

    Hi Thomas,

    Have you checked this blog?
    And this wiki?

    Kind regards,
    Cris

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Thomas,


      I think I got it. Let me explain what I did.

      1) Put a F4 Help Text Field and a Label in a new flavor. The F4 Help Text Field was linked to SUID_ST_BNAME table, BNAME field. The Label is meant to hold a text after I double click an item from the search help.

      2) I wrote 2 scripts, for OnLoad and OnAfterRefresh screen events.


      The scripts:

      OnLoad:

      var userID = session.findById("wnd[0]/usr/ctxtPersonas_152459447653923").text;
      session.utils.put("user",userID);
      session.findById("wnd[0]/usr/lblPersonas_152459451218351").text = "";

      OnAfterRefresh:

      var userID = session.utils.get("user");
      var userF4 = session.findById("wnd[0]/usr/ctxtPersonas_152459447653923").text;

      if (userID == userF4) {
      return true;
      }

      session.utils.put("user",userF4);
      session.findById("wnd[0]/usr/lblPersonas_152459451218351").text = userF4;

      As you can see, when the screen is loaded, I get the text from the F4 Help Text Field and keep in memory. The label text is cleared.

      When I use the search help and double click an element, the second script comes into action: I get the previous value, from memory, and compare with the actual result, already written in the field. If they are equal, I do nothing, otherwise I store the new value and display it in the label.

      Is this something you already tried? Does it fit your needs?

      Kind regards,

      Cris