3.7 Graphical menus

iWeb development did pay some deal of attention to menu management, in order to achieve a really friendly user presentation, yet preserving the original application properties.

iWEB strictly follows the iSeries rules used in an application to implement menus.
Each menu item operates in the same job as the initial menu, as it happens in a 5250 session.
This rule strictly applies even in the case of a menu issued from a program down in the invocation stack.
The implementation strategy was to have iWEB being in control of every "go" command, thus preserving vital job properties, such library list, current library, and all the like.

As to the presentation format, the "tree" format was by no doubt the best we would support (see the next figure). 
"Tree menu" example
Figure 03-30 Graphical tree menu How would you like to have your logo instead of this one?
Just replace IFS stream file
/iwebdata/images/sfondoApplet.jpg
with your own jpg!

 

Types of menus Menus

There are three types of user-defined menus: DSPF menus, UIM (reference) menus, and program menus (see Menu Design in IBM iSeries Information Center).

iWEB converts DSPF and program menus, does not convert UIM menus.

 

DSPF Menus

iWeb, during its conversion phase, scans the MNUDDS source and the related message file in order to come up with a "branch" of a tree menu. Connecting menu with user profile iWEB graphical management will display menu structure.  

5250 menu IWEB tree menu
Figure 03-31 DSPF menu Figure 03-32 IWEB tree menu

 

The appropriate way to close a menu - and at the same time, to kill the related iSeries job - is to click the 'X' at the menu top-right. 

How to close a menu
Figure 03-33 How to close a menu

 

Program menus

Some applications may use programs to display menu-like screens.
For instance, a common case would be that of a general menu program, receiving some parameter, then retrieving the menu items from a datagase file and displaying them on the screen, through a menu-like display record format.

Now, there is nothing in the program itself from which one could tell that it is a menu. This is why iWEB cannot detect it as a menu, unless the developer tells it.

In order to tell iWEB that a program is a menu, you have to do the following:

  1. open a 5250 session
  2. CRTDUPOBJ OBJ(IWMENU) FROMLIB(IWEB) OBJTYPE(*FILE)
       TOLIB(your_application_library)
  3. use a DFU to add to this file a record documenting your menu (see Figure 03-34 for the layout of this file)
  4. IWEB/IWMENU2XML IWMENULIB(your_application_library)
IWMENU archive
Figure 03-34 IWEBMENU record format

 

GO command

In order to be able to work with menus, iWEB gets full control of any "go" command, no matter how the menu was born (mnudds or database).

This bears some implications.
For instance, if a user profile is associated to an initial program that issues a GO command, that program has better find out whether it is running in 5250 or in WEB mode.
The following statements, when added to such a program, would put it in control of the running environment.
C                   call      'IWEB/ISIWEB'                                              
C                   parm                    isweb             1                          
C                   if        isweb='1'                                                  
 *            statements reflecting the fact that this program is running in WEB mode    
C                   else                                                                 
 *            statements reflecting the fact that this program is running in 5250 mode   
C                   endif