The Java "Tool Kit" is designed to provide a user friendly data entry form deigned to enter, edit and Save a "Collection" of information from your applications end user via. The "heart" of the com.jFormTK Development System is the JFormField which is designed to represent each field of each Form in an com.jFormTK Application.
Table of Contents... |
Framework Overview. |
Creating an Application Form. |
Using the JFormField Field Object. |
JFormField Properties. |
The com.jFormTK Group Usage. |
Application Field Referencing. |
The following figure illustrates a completed JFormForm. It is the "Family
Physicians" Form from the Professional Computer Solutions [PCS] Survivors List PLUS
Application.
The blue with black print annotations point to the five major sections of a
JFormForm as follows:
The JFormFrame Control Buttons.
These buttons are the system defaults. Each button may be removed or disabled as required.
The button order is also controlled by the Application Developer either for the entire
Application or on a per Form basis.
See the Framework documentation for a detailed description of these com.jFormTK objects.
Creating an Application Form.After the custom JFormForm has been Created and the initial JFormFields have been inserted onto the JFormForm , the JFormForms showForm Method is used to show the completed JFormForm.
Using the JFormField Field Object.
Each field is instanced using one of the
JFormField Constructors. For example the "Specialty" Field that is
annotated on the above sample Form is created using the following JFormField
Java statement:
JFormField Specialty = new JFormField(this, "Specialty", "Specialty:
",
"Enter the Doctor's Specialty, e.g General Pratictioner",
_NotRequired, _NoHint, _TField, _FldSize, _FontSize);
Specialty.setText("General Practitioner");
util.addObject (this, DoctorSpecialty, 2, Row, 3,1, GroupName, "");
The following table shows the fields of the com.jFormTK.JFormField constructor and a description of each parameters usage by the above Specialty Field" code snippet:
Parameter: | Description | Specialty Usage |
JFormForm f | The host JFormForm | Generally use the Java this field to identify the Current JFormForm class. |
String name | Name used in ID Field | "Specialty" |
String s | Name used to label the Field | "Specialty:" |
String p | User "Prompt Line | "Enter the Doctor's Specialty, e.g General Pratictioner", |
boolean rFlag | Required Field Flag | _NotRequired * |
boolean Hint | Hint Button Flag | _NoHint * |
char Type | JFormField Type = 'B'
Action Button |
_TField * |
int TextFieldSize | Text Field Size | _FldSize * |
int FontSize | Text Field Font Size | _FontSize * |
* - The com.jFormTK has a set of mnemonic string used
to make the usage of the various com.jFormTK Constructors easier to read.
They start with the _ character. Some examples
that apply to the above table are as follows:
boolean for Required Field Flag: _NotRequired, _Required.
boolean for Hine Button existance: _NoHint, _Hint.
char for the JFormField Type: _BField, _CField, LField,
_TField, _XField, _Rfield
int for Text Field Size: _FldSize
int for Text Field Font Size: _FontSize
These controls have a com.jFormTK System Default set that may be modified for
each Application via usage of the com.jFormTK Data Base methods.
** - The A and D Types are used to control the run-time addition or deletion from a com.jFormTK Group Table. This "GroupName tabular processing is described later in this document.
Each JFormField" has the following properties:
postfix the constructed Help
String with the given String.
- public void replaceHelp(String s)
replace the constructed Help String with the given
String
Most data entry forms require a Variable number of
"Data Sets" to be entered by the end user. For Example, the Survivors List PLUS
Physicians Form requires that the end user enter information for all the
Family Doctors. For each Doctor, the following four fields [JFormFields] are
required: DoctorName, Patient, Specialty and Phone Number. These fields represent a
"Data Set" for each Doctor.
To enter a variable number of Sets to a JFormForm, the Java Form Tool Kit [com.jFormTK]
uses the "Group" Concept. A "GroupName" is specified and the
number of "Data Set" fields and number of "Data Set Display Rows" are
identified for each Form "Group". Special JFormField Buttons are
used to add or remove Data Sets to / from each Group of an Application Form.
For example, with the Physicians Form of the Professional Computer Solutions
Survivors List PLUS Application the "Group Name" is "Doctors", the
number of fields per data set is 4 [Name, Patient, Specialty, Phone] and the number of
rows per set is 2. This com.jFormTK form then uses a More Doctors
Button to add a variable number of Physicians to the Application "Doctors Group
and the Remove Doctors to remove a Physician from the Doctors
Group. See the "Family Physicians Survivors List PLUS figure above.
Earlier in this document, the JFormField identifier
was described. If a Form Field is one of the elements of a "Group Data Set",
then the Group Name [GroupName] and Set number [SetNumber] parts of the
JFormField ID must be used to uniquely identify each element of a
com.jFormTK Group.
For example, the JFormField.getID method for the "Specialty" Field
of the second Doctor in the above Survivors List PLUS Family Physicians Form
would yield the following identification String: "Doctors.Specialty.1".
To uniquely reference the above JFormField from another Application Form, the above JFormField ID shall be prefixed with the Survivors List PLUS Family Physicians ID. For example, if the Category = "Directory", Sub Category = null [not sed], and the JFormForm File Name is = "Physicians", then the JFormForm ID would be "Directory.Physicians" and the complete JFormField Reference to the above 2nd Specialty Field would be as follows:
"Directory.Physicians.Doctors.Specialty.1"