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 thecustdemo
schema will be used by the compiler to determine the data types of the form fields. - Line
4
defines aVBOX
vertical box that contains aTABLE
and aGRID
container. - Lines
5
thru14
define theTABLE
container to hold the list of customer record. - Lines
15
thru22
define theGRID
container that groups additional fields. - Lines
30
thru42
: TheATTRIBUTES
section contains form field definitions linked to item tags in theLAYOUT
section. - Lines
31
thru38
define the form fields of the customer record list controller by the programDISPLAY ARRAY
. - Lines
39
thru41
define form fields of theGRID
container, that will be displayed individually by the program code. - Line
45
defines the screen array in theINSTRUCTIONS
section. The screen record elements must match the column list in theTABLE
container. This example defines the screen record with all fields defined with thecustomer
prefix.PHANTOM
fields will be part of the data set, but are not displayed in theTABLE
container.