Building Data Forms with the Form Builder

The WFM Data Form is a Java-based form that maintains (edit, update delete) data within database tables and views. Data Forms are created through the Form Builder. Each time a data form is generated by an authorized end-user, the system returns the most current, up-to-date database information. Data forms can be created to point to a single database table or to various database tables. Alternatively, data can queried using SQL statements.

This section outlines features and processes that are specific to creating Data Forms in the Form Builder. The general processes for creating a form or report and adding various controls to the form or report, are described earlier in this chapter.

Data forms always contain at least three elements:

The data source retrieves information from database tables. The DB Table represents a grid-like table that stores the database information that is retrieved by the data source, which, in turn, can point to one or more database tables. Field controls reference only the database table fields to which the data source points.



In the following two examples, four Label field controls have been added to the DB Table. The DB Table points to the data source, which in turn points to the EMPLOYEE table. As such, the field controls in these examples can only reference fields from the EMPLOYEE table.

The label in the first column of the second row (cell A2) within the DB Table points to the EMP_LASTNAME field of the EMPLOYEE table while the label in the second column of the second row (cell B2) within the DB Table points to the EMP_FIRSTNAME field of the EMPLOYEE table.



The field controls have been named EmpLastName and EmpFirstName, respectively.

About the DB Table Heading Row

A DB Table always contains one heading row. This heading row is displayed along the top or left column of the DB Table (depending on the DB Table orientation). Heading rows do not reference a data source – they simply represent heading descriptions for the DB Table data column or row. Therefore, the Datasource property of any field control within a DB Table heading row is always blank.

In this example, a Label field control in the heading row of a DB Table is highlighted. The Datasource property is blank.



This screen is another example:



In this example, the highlighted Label field control is not in the heading row of a DB Table. The Datasource property automatically populates with the data source to which the DB Table points.



Viewing Data Form Output

Each time the data form is generated, the first column of the DB Table retrieves and displays a list of employee first names taken directly from the EMP_FIRSTNAME column of the EMPLOYEE table. Likewise, the second column of the DB Table retrieves and displays a list of employee last names taken from the EMP_LASTNAME column of the EMPLOYEE table.

For example, the following window displays the results for when the user generates the data form:



Data forms can be as simple as the example above or they can be as complex as the following example.

The data form in the following example, called My Good Deeds, contains:

  • Three (3) data sources, where one points to a database table while the other two contain queries.
  • Two (2) DB Tables, each pointing to a different data source
  • Six (6) field controls that point to various columns within their respective DB Tables.

Other field controls have also been added to the form to structure the data form into a usable layout.