You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

[ |../../index.htm#lansa/lansa050_1020.htm]
現在地: RAMP-TSガイド > 画面の拡張 > HTMLAPI スクリプト・オブジェクト > 基本的な標準レイアウト・ファンクションを実装する

基本的な標準レイアウト・ファンクションを実装する

最初に、以下のファンクションを SHARED スクリプト・オブジェクトの一部として uf_sy420_rts.js ファイルに追加します。
 
var SHARED =
{
 
   /* ------------------------------------------------- */
   /* Apply standard layout changes to arriving screens */ 
   /* ------------------------------------------------- */
 
   ApplyStandardLayout : function()
   {
 
      /* Use the HTMLAPI to hide lines 1 and 2 on all screens */
 
      HTMLAPI.hideRow(1);
      HTMLAPI.hideRow(2);
 
   }, 
 
など
 
これで、RAMP 画面の到着スクリプトから呼び出すことができる、SHARED,ApplyStandardLayout という標準ファンクションができました。
例えば、サンプルのデスティネーション画面の到着スクリプトを以下のように変更して、スクリプトが 5250 画面を表示する直前にこの新しいファンクションを使用します。
 
   vHandle_ARRIVE: function(oPayload, oPreviousForm)
   {
     /* If the department input field exists on the screen, display it */
 
     if ( CHECK_FIELD_EXISTS("DEPTMENT") )
     {
 
        SHARED.ApplyStandardLayout();
 
        SHOW_CURRENT_FORM(true);
        HIDE_5250_BUTTONS();
        SETCURSORTOFIELD("SURNAME");
        SETBUSY(false);
     }
 
     /* Otherwise send an F21 key to make the screen input capable  */
 
     else
     {
        SENDKEY(KeyF21);
     }
 
     /* <ARRIVE /> - Do not remove or alter this line */
 
     return(true);
   },
 
実行すると、結果の画面は以下のようになります。

 
画面の行 1 と 2 が非表示になります。
これは非常に簡素なジェネリックなレイアウト規則ですが、その他の多くの 5250 画面に対して利用できるより重要なジェネリックな規則を実装できる基盤ができました。
 
[ |../../index.htm#lansa/lansa050_1020.htm]

  • No labels