Form example: custlist.per
The custlist.per form specification file contains a GRID container
that holds a GROUP
container and a TABLE
container specified as
form layout tags with < >
markers. The GROUP
container holds a field for QBE input, and the TABLE
container displays the
customer
rows found with the SQL query.
The custlist.per form filed:
1 SCHEMA custdemo
2
3 LAYOUT (TEXT="Customers",WINDOWSTYLE="dialog")
4 GRID
5 {
6 <GROUP g1 >
7 Customer: [fc :fe ]
8 < >
9 <TABLE t1 >
10 [f1 |f2 |f3 ]
11 [f1 |f2 |f3 ]
12 [f1 |f2 |f3 ]
13 [f1 |f2 |f3 ]
14 < >
15 }
16 END
17 END
18
19 TABLES
20 customer
21 END
22
23 ATTRIBUTES
24 GROUP g1: TEXT="Filter";
25 EDIT fc = customer.cust_name, STRETCH=X;
26 BUTTON fe: fetch, IMAGE="filter";
27 EDIT f1 = FORMONLY.s_num, TITLE="Id";
28 EDIT f2 = FORMONLY.s_name, TITLE="Name";
29 EDIT f3 = FORMONLY.s_city, TITLE="City";
30 END
31
32 INSTRUCTIONS
33 SCREEN RECORD sa_cust(FORMONLY.*);
34 END
Note:
- Line
1
defines the database schema to be used for this form specification file. - Lines
3
thru17
define theLAYOUT
section of the form with aGRID
containing andGROUP
andTABLE
container specified with layout tags. - Lines
3
defines theLAYOUT
block with aWINDOWSTYLE
attribute set to"dialog"
: This points to the style attribute defined in the FGLDIR/lib/default.4st file, to get a modal window. - Lines
19
thru20
declare the use of thecustomer
SQL table definition of thecustdemo
schema. - Lines
23
thru30
declare form field attributes for the table columns. - Line
24
defines theTEXT
attribute for theGROUP
container, identified with theg1
item tag name. - Line
26
defines aBUTTON
form item, bound to theON ACTION fetch
action handler in the program code, to query thecustomer
table of the database. - Lines
32
thru34
define the form instructions. - Line
33
declares thesa_cust
screen array, used to group form fields that define theTABLE
columns.