Versions Compared

Key

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

13.4.6 Hidden Field Attribute and the Select Field Attribute

Attributes

Description

*HIDE   *HIDDEN

These attributes are synonyms.

Use of these attributes indicates that the field is to be "hidden" and not displayed on the screen.

This attribute is primarily intended to allow fields to be included into a browse list but not actually displayed on the screen. Refer to the DEF_LIST command for more information about lists and list processing.

*SEL  *SELECT

These attributes are synonyms.

Use of this attribute indicates that a field is to be used to "select" an entry from a list. Fields with this attribute are input capable no matter what the display mode. Refer to the DEF_LIST and SELECTLIST command for more details of lists and list processing.

Examples

The following RDML program uses the *HIDDEN and *SELECT attributes and requests that the user input a generic customer name. All customer names that match are displayed and any of them can be selected for detailed display:

     DEFINE   FIELD(#CHOOSE) TYPE TYPE(*CHAR) LENGTH LENGTH(1) COLHDG COLHDG('Sel')
DEF_LIST NAMEDLIST NAMED(#BROWSE)  FIELDS((#CHOOSE #CHOOSE *SELECT) #NAME (#CUSTNO  #NAME (#CUSTNO *HIDDEN))
GROUP_BY NAMEBY NAME(#CUSTOMER) FIELDS(#CUSTNO #NAME #ADDR1 #ADDR2 #POSTCD)
FIELDS(#CUSTNO #NAME #ADDR1 #ADDR2 #POSTCD)
REQUEST    FIELDS(#NAME)
CLR_LIST   NAMED(#BROWSE)
SELECT  FIELDS(#BROWSE) FROM FROM_FILE(CUSMSTV1) WITH WITH_KEY(#NAME) GENERIC GENERIC(*YES)
ADD_ENTRY  TO_LIST(#BROWSE)
ENDSELECT

DISPLAY    BROWSELIST(#BROWSE)
SELECTLIST NAMED
SELECTLIST NAMED(#BROWSE) GET GET_ENTRYS(*SELECT)
FETCH      FIELDS(#CUSTOMER) FROM FROM_FILE(CUSMST) WITH WITH_KEY(#CUSTNO)
DISPLAY    FIELDS(#CUSTOMER)
ENDSELECT

Some points to note about this RDML program are:

  • The first block of executable commands requests that the user input a customer name and then builds a list of all customers that have a generically identical name.

  • The first DISPLAY command displays the list built by the first block of code. When displayed the list would look something like this:

     Sel     Customer name

      _      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     

      _      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     

                Sel     Customer name

                 _      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     

                 _      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     

                 _      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX         _      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX      

         Note the input capable "Sel" column. This resulted from assigning the *SELECT attribute to field #CHOOSE.

...

          DEFINE    FIELD(#CHOOSE) TYPE(*CHAR) LENGTH(3) COLHDG('Sel')
   DEF_LIST NAMED(#BROWSE) FIELDS((#CHOOSE *SELECT) #ORDER #DATDUE)
   REQUEST   FIELDS(#DATDUE)
   CLR_LIST  NAMED(#BROWSE)
   SELECT    FIELDS(#BROWSE) FROM_FILE(ORDHDRV3) WITH_KEY(#DATDUE)
   ADD_ENTRY TO_LIST(#BROWSE)
   ENDSELECT

   DISPLAY   BROWSELIST(#BROWSE)
    --> SELECTLIST NAMED(#BROWSE) GET_ENTRYS(*SELECT)
   |
   |      CASE       OF_FIELD(#CHOOSE)
   |
   |      WHEN       VALUE_IS('= CUS')
   |                 < display customer details >
   |      WHEN       VALUE_IS('= DET' '= LIN')
   |                 < display line item details >
   |      WHEN       VALUE_IS('= HIS')
   |                 < display customer payment history >
   |      WHEN       VALUE_IS('= STS')
   |                 < display order status >
   |
   |      ENDCASE
    |
         |
    --- ENDSELECT ENDSELECT
  • Note that like the first example the commands request that a "date order due" be input. A list of all associated orders is then built and displayed. When displayed the list would look something like this:

     Sel     Order     Date Due

                Sel     Order     Date Due

                       _     9999999     99/99/99           

                 _     9999999     99/99/99     

                       _     9999999     99/99/99           

                 _     9999999     99/99/99 99     

  • The SELECTLIST / ENDSELECT loop requests that all entries in the list that have a non-blank value in field #CHOOSE be processed. However, the loop also acts upon the content of field #CHOOSE to display customer, line item, payment history or status information about the order.