Adding a screen rule for the menu

Top  Previous  Next

We will need to define new screen rules for both screens.

 

Firstly, we will look for the "MAIN MENU" label to identify the first screen .

 

In addition (as we want to skip this screen) we will add two new versions of the actions defined for the previous screen. For the "main" action we must type "01" in the option field and then press <ENTER>. The second actions you have to add is "exit", because we only need to send a PF1 key. 

 

 

Note, in the following rule definition, the addition of the "input" user field will be used in "main" as "hs.data.option".

 

   hs.register({

       id: 'bluecardMainMenu',

       match: [{ text: 'MAIN MENU', row: 1, col: 35 }],

       apply: {

           fields: [

               { name: 'option', row: 18, col: 63, len: 2 },              

           ],

           actions: {

               main: function (hs) {

                   hs.data.option = '01';

                   hs.enter();

               },

               exit: function (hs) {

                   hs.pf1();

               }

           }

       }

   });

 

If we run the application now and press the "Sign in" button on the login page, it will take us directly to "Account Information" screen. The "main" action will be executed in 'bluecardLogin' screen first and then in 'bluecardMainMenu' screen. The resultant screen has no rule yet, therefore, no more "main" actions are found and the navigation sequence stops.

 

Now we are ready to complete this demo, adding a page for the application menu.