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 thru 17 define the LAYOUT section of the form with a GRID containing and GROUP and TABLE container specified with layout tags.
  • Lines 3 defines the LAYOUT block with a WINDOWSTYLE 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 thru 20 declare the use of the customer SQL table definition of the custdemo schema.
  • Lines 23 thru 30 declare form field attributes for the table columns.
  • Line 24 defines the TEXT attribute for the GROUP container, identified with the g1 item tag name.
  • Line 26 defines a BUTTON form item, bound to the ON ACTION fetch action handler in the program code, to query the customer table of the database.
  • Lines 32 thru 34 define the form instructions.
  • Line 33 declares the sa_cust screen array, used to group form fields that define the TABLE columns.