Form example: custlist.per

The custlist.per form specification file contains a TABLE container and screen array used to display a list of customer rows.

Form custlist.per:
 1 SCHEMA custdemo
  2 
  3 LAYOUT (TEXT="Customer list")
  4 VBOX
  5 TABLE
  6 {
  7  Id    Name                  City           St  Zipcode
  8 [f1   |f2                   |f3            |f4 |f5     ]
  9 [f1   |f2                   |f3            |f4 |f5     ]
 10 [f1   |f2                   |f3            |f4 |f5     ]
 11 [f1   |f2                   |f3            |f4 |f5     ]
 12 [f1   |f2                   |f3            |f4 |f5     ]
 13 }
 14 END
 15 GRID
 16 {
 17 Address: [f6                                           ]
 18          [                                             ]
 19 Contact: [f7                                 ]
 20 Phone:   [f8                    ]
 21 }
 22 END
 23 END
 24 END
 25 
 26 TABLES
 27 customer
 28 END
 29 
 30 ATTRIBUTES
 31 EDIT f1=customer.cust_num;
 32 EDIT f2=customer.cust_name;
 33 PHANTOM customer.addr;
 34 EDIT f3=customer.city;
 35 EDIT f4=customer.state;
 36 EDIT f5=customer.zipcode;
 37 PHANTOM customer.contact_name;
 38 PHANTOM customer.phone;
 39 TEXTEDIT f6=FORMONLY.cr_addr, STRETCH=BOTH;
 40 EDIT f7=FORMONLY.cr_contact_name;
 41 EDIT f8=FORMONLY.cr_phone;
 42 END
 43 
 44 INSTRUCTIONS
 45 SCREEN RECORD sa_cust(customer.*);
 46 END
Note:
  • Line 1 declares that the custdemo schema will be used by the compiler to determine the data types of the form fields.
  • Line 4 defines a VBOX vertical box that contains a TABLE and a GRID container.
  • Lines 5 thru 14 define the TABLE container to hold the list of customer record.
  • Lines 15 thru 22 define the GRID container that groups additional fields.
  • Lines 30 thru 42: The ATTRIBUTES section contains form field definitions linked to item tags in the LAYOUT section.
  • Lines 31 thru 38 define the form fields of the customer record list controller by the program DISPLAY ARRAY.
  • Lines 39 thru 41 define form fields of the GRID container, that will be displayed individually by the program code.
  • Line 45 defines the screen array in the INSTRUCTIONS section. The screen record elements must match the column list in the TABLE container. This example defines the screen record with all fields defined with the customer prefix. PHANTOM fields will be part of the data set, but are not displayed in the TABLE container.