7 76 3 POP_UP Examples

LANSA Technical

7.76.3 POP_UP Examples

The following examples apply to the POP_UP command. For further examples refer to the DISPLAY command which is functionally identical.

Example 1: Present fields #ORDNUM, #CUSTNUM and #DATEDUE to the user in a pop up window located in the center of the screen:

POP_UP    FIELDS(#ORDNUM #CUSTNUM #DATEDUE)
 

or, identically:

GROUP_BY  NAME(#ORDERHEAD) FIELDS(#ORDNUM #CUSTNUM #DATEDUE)
POP_UP    FIELDS(#ORDERHEAD)
 

Example 2: Display an order, including all line details in a scrollable area, in a pop up window:

GROUP_BY  NAME(#ORDERHEAD) FIELDS(#ORDNUM #CUSTNUM #DATEDUE)
DEF_LIST  NAME(#ORDERLINE) FIELDS(#ORDLIN #PRODUCT #QUANTITY #PRICE)
 
POP_UP    FIELDS(#ORDERHEAD) BROWSELIST(#ORDERLINE) AT_LOC(5 10) WITH_SIZE(*AUTO)
 

Example 3: Request #ORDNUM #CUSTNUM and #DATEDUE and also specify specific positions and identification methods as field attributes.

For details of field attributes, refer to Field Attributes and their Use.

When specific positions for a field are nominated, the automatic design facility is effectively "disabled". For example,

GROUP_BY  NAME(#ORDERHEAD) FIELDS((#ORDNUM  *COLHDG *L3 *P3 ) (#CUSTNUM *LABEL  *L3 *P24) (#DATEDUE *NOID   *L7 *P37)) 
 
POP_UP    FIELDS(#ORDERHEAD) AT_LOC(*UPPER) TEXT(('--DATE--' 6 37))
 

would cause a popup something like this to be designed:

         ----------------------------------------------------- 

        :                                                     :

        :  Company    Customer no:                            :

        :  Order                                              :

        :  Number                                             :

        :                                        --DATE--     :

         ----------------------------------------------------- 

 

Note that the manual specification of row and column numbers and "text" is not required. The screen design facility can be used to modify an "automatic" design much more quickly and easily. For details, refer The Screen Design Facility in the LANSA for i User Guide.

After the screen design facility has been used on a POP_UP command, the associated FIELDS parameter (in the POP_UP or GROUP_BY command) will be automatically re-written with the required row, column and method of identification attributes.

Remember that if an expandable group expression was used, LANSA will substitute the expression with the fields that constitute it.

In addition, the TEXT parameter of the POP_UP command will also be automatically re-written.

 

Example 4: Use an Expandable Group expression and redesign the layout using the screen design facility:

GROUP_BY   NAME(#XG_ORDHDG) FIELDS(#ORDNUM #CUSTNUM #DATEDUE)
POP_UP     FIELDS(#XG_ORDHDG) DESIGN(*ACROSS) IDENTIFY(*COLHDG)
 

The popup designed automatically would look like this:

          --------------------------------------------- 

         :                                             :

         :   Company   Order     Date                  :

         :   Order     Customer  Order                 :

         :   Number    Number    Due                   :

         :   ________  ______    ______                :

         :                                             :

          --------------------------------------------- 

 

If the layout is changed using the screen design facility to look like this:

 

            Company   Order                                           

            Order     Customer                                        

            Number    Number                                          

            ________  ______       Date Order Due   ______            

 

 

then the POP_UP command FIELDS parameter will be expanded as follows:

POP_UP     FIELDS((#ORDNUM *L2 *P3) (#CUSTNUM *L2 *P13) (#DATEDUE *L5 *P26 *LAB)) DESIGN(*ACROSS) IDENTIFY(*COLHDG)