The com.jFormTK Kernel maintains an instance of the JAddressBook Class for each com.jFormTK Application. This document is designed to describe the Dynamic [Run-Time] JAddressBook features available in the 'com.jFormTK' Kernel. There are Post Processing features to dynamically add a new entry to the JAddressBook and to update fields of an existing JAddressBook Entry.

1. "Dynamic Address Book Add" Parameters...

The following JFormField Parameters are used by the com.jFormTK Kernel during run-time to Add a name into the JAddressBook during a JFormField's Post Processing phase:

. addressBookNameID - JFormField ID where the JAddressBook Name is found.

. addressBookTypeID - JFormField ID where the new JAddressBook Entry 'Type' is entered.

. addressBookTypeValue - a String containing the new JAddressBook Entry Type.

'JFormFrame.postProcess' Method Processing:

If the 'addressBookNameID' is NOT a 'null'
Then
   add an item to the JAddressBook with the Name set to the value found in the
   JFormField identified by the 'addressBookNameID'.

Set the new JAddressBook items 'type' field as follows:

If 'addressBookTypeID' is Not null
Then set the new JAddressBook entry 'Type' from the value in the
     given com.jFormTK JFormForm ID.
Else set the new JAddressBook entry 'Type' from the value in the
     'addressBookValue' JFormField parameter…

Examples / JFormField Methods:

1:
To add a new 'JAddressBook' Entry when the Type is in a 'JFormField' field [e.g. fieldType] and the Name is in another 'JFormField' field [e.g. fieldName]:

triggerField.addToAddressBook(fieldName.getID(), fieldType.getID());
where 'triggerField' is the JFormField field that "triggers" the add
      to JAddressBook "Post Processing" operation.

2:
To add the contents of the current JFormField [name] to the JAddressBook instance with the 'type' field set to "Executor":

name.addToAddressBook("Executor");

3. The full signature 'addToAddressBook'Method enters all of the above parameters and allows the 'com.jFormTK' developer to control the 'type' setting during run-time

fld.addToAddressook(nameID, typeID, type);

NOTE 1:
In addition to the above JFormField Methods there are "set" / "get" method for each of the above JAddressBook "Add" Control Parameters.

NOTE 2:
These operation were originally specked to handle multiple 'addToAddressBook' operations via any one 'JFormField" instance. To date, this has not been implemented because the usefullness of such a feature is undetermined.

 

2. "Dynamic Address Book Update" Parameters...

The following JFormField Parameters are used by the com.jFormTK Kernel to Update the fields of an existing JAddressBook entry:

. updateAddressBookAnchor - JAddressBook Anchor for the entry to be updated.

. updateAddressBookFieldType - String that specifies the 'jAddressBook' Field to be      updated. This parameter MUST contain one of the following                          'jAddressBook' Field Types [Shown in quotes]:

Category Fields...
Name "First", "Middle", "Last", "Suffix"
Type "Type"
Anchor  "Anchor"
Address  "Address1", "Address2", "City", "State", "ZIP", "Country"
Phone   "Phone", "Fax", "Cellular", "Pager"
Personal "DateOfBirth", "SocialSecurityNumber", "EMail", "PersonalWebPage"
Note "Note"

. updateAddressBookValueID - a 'JFormField' ID of the field that contains the value to be stored in the jAddressBook's specified Field Type [updateAddressBoookFieldType] OR a "Reference" String. Note that a "reference" Sting must contain a "Reference Prefix" [i.e. <v>, <c>, <u>] that defines the "Reference Type" processing.

Another feature of the 'updateAddressBookValueID' field is the 'null' String processing.
If the 'updateAddressBookValueID' is null, i.e. equals "" OR " ",
Then the "Value" added to the jAddressBook Type field is the "*this*.getText()" String, i.e. the contents of the associated 'JFormField' Text Field shall be used.

. updateAddressBookNoteID  - an "Annotation" to be "appended" to the "Note" Text of the 'jAddressBook' Item specified by the 'updateAddressBookAnchor'. This field may be a 'JFormField' ID OR a "Reference" String.

If the 'updateAddressBookNoteID is a 'null' field,
Then no action is taken, i.e. there is no "*this*.getText()" processing for a 'null' content of this 'updateAddressBookNoteID' control parameter.

'JFormFrame.postProcess' Method Processing:

If the 'updateAddressBookAnchor' is NOT a 'null'
Then
   - Fetch a "Reference" [abEntry] to the JAddressBook entry that is unique for the given       JAddressBook Anchor.

   - Create a "Reference" to the field to be update [fld] in the 'abEntry' entry.

   - If the 'updateAddressBookValueID' is 'null'
     Then
        - set the field to be updated [fld] to the current JFormField Text Value.
     Else
        - set the field to be updated [fld] from the Text Value of the unique Application
          JFormField indicated by the given 'updateAddressBookValueID
     End If

   - If the 'updateAddressBookNoteID' is NOT 'null
     Then
        - Append the "to be Updated" JAddressBook entry [abEntry] "Note" field with the
          Text Value of the unique JFormFiled specified by the 'updateAddressBookNoteID'.

     End If

Examples / JFormField Methods:

1:
To set the "Phone" field of the JAddressBook Entry at Anchor A [anchorA] to the current content of the 'testB' JFormField:

testB.updateAddressBook(anchorA, "Phone");

2: To set the "Phone" field of the JAddressBook Entry at Anchor A [anchorA] to the current content of the 'testA' JFormField:

testB.updateAddressBook(anchorA, "Phone", "testA");
where 'testA' is a JFormField in the current JFormForm sub-class.

NOTE: If the JFormField that contains the phone value is in another JFormForm sub-class,
      Then use the full JFormField ID that uniquely identifies the require JFormField.

3: Same as example 2 [above] only also "Append" the Note from the 'noteA' JFormField.

testB.updateAddressBook(anchorA, "Phone", "testA", "noteA");
where 'testA' is a JFormField in the current JFormForm sub-class.
      'noteA' is a JFormField in the current JFormForm sub-class.

NOTE 3:
In addition to the above JFormField Methods there are "set" / "get" methods for each of the above JAddressBook "Update" Control Parameters.