Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

SKeyName

必要。キーの名前を含む文字列。 詳細は「SENDKEY ファンクションのファンクション・キー名」を参照してください。

oPayload

任意。 ファンクションで渡されるオブジェクト。

...

オブジェクトが作成され、EnterキーBUTTONCLICKイベントで値がロードされます。次に、オブジェクトはSENDKEY ファンクションのoPayloadパラメータとして渡されます。

   /* ====================================================== */
   /* ==================  BUTTONCLICK  ===================== */
   /* ====================================================== */
   /* sButton: The button that was clicked */
   vHandle_BUTTONCLICK: function(sButton)
   {
     var bReturn = true;
     if (HANDLE_PROMPT()) return(bReturn); /* If the focus element is automatically prompted finish now */

     /* <BUTTONCLICK /> - Do not remove or alter this line */
           /* Handle function keys and buttons */
           switch (sButton)
        {
           case KeyEnter:

...

             var objEmp = new Object();

...

                 objEmp.strEmpno = GETVALUE("empno");

...

                 objEmp.strGName = GETVALUE("givename");

...

                 objEmp.strSName = GETVALUE("surname");

...

                 SENDKEY(KeyEnter,

...

 objEmp);
                 break;
           case KeyF3:
                 SENDKEY(KeyF3);
                 break;
           case KeyF4:
                 SENDKEY(KeyF4);
                 break;
           case KeyF12:
                 SENDKEY(KeyF12);
                 break;
           case KeyF14:
                 SENDKEY(KeyF14);
                 break;
           case KeyF21:
                 SENDKEY(KeyF21);
                 break;
           case KeyF22:
                 SENDKEY(KeyF22);
                 break;
              default:
                 SENDKEY(sButton);
                 break;
        }

     return(bReturn);


 
次に、結果の画面のvHandle_Arriveファンクションはペイロードが渡された場合にペイロードから値を取得します。

   /* ====================================================== */
   /* ==================  vHandle_ARRIVE  ================== */
   /* ====================================================== */
   /* Handle arrival at this Destination */
   /* oPayload: The payload supplied by the event initiator */
   /* oPreviousForm: Reference to previous object Form*/
   vHandle_ARRIVE: function(oPayload, oPreviousForm)
   {
     var bReturn = true;
     SHOW_CURRENT_FORM(true); /* Show the form in the framework and show VLF buttons */
     HIDE_5250_BUTTONS();     /* Hide any 5250 style buttons displayed               */
     GET_FORM_MESSAGE(22);    /* Extract messages and hide the message line          */
     SETBUSY(false);          /* Last thing done - turn off the busy state           */

...

     /*

...

 if there is something in the payload */

...

     if (oPayload !=

...

 null)

...

     {

...

        ALERT_MESSAGE("

...

Employee Details from the payload are: Employee Number: ",

...

 oPayload.strEmpno,"Name: ",

...

 oPayload.strGName,

...

 oPayload.strSName);

...

     }
     /* <ARRIVE /> - Do not remove or alter this line */
     return(bReturn);
   },