template_banner.gif Main Index  PREV  NEXT

Valid HTML 4.01!   Valid CSS!

Multi-Purpose Forms

Overview

These are called multi-purpose forms because they allow several functions (e.g. SELECT, LIST, ADD, MODIFY and DELETE) to be performed in a single component rather than having a separate component for each function.

There are several reasons why this type of component may be chosen:-


Multi 1 - Maintain occurrences, multiple occurrence display

CT_MULTI1.gif

Description

This type of form is for those entities where the number of fields is so small that each occurrence can be displayed on a single line. Two fields are shown in this example, but there may be more.

Upon initial entry the form will perform an automatic retrieve of all available entries, therefore may not be suitable for a table with large volumes of data.

The user makes whatever modifications are required, then preses the OK button to update the database, terminate and return control to the previous form.

Buttons

OK Will commit all changes to the database (provided that all validation is successful), then exit and return control to the parent form.
CANCEL Will abandon all outstanding changes and return control immediately to the parent form.
ADD Will present the user with an empty occurrence so that a new entry may be input. The database will not be updated until the OK button is pressed.
DELETE Will delete the current occurrence from the screen, provided that no subordinate entries exist. The database will not be updated until the OK button is pressed.

Contents

Bound Objects

Source Entity Source Field Target Entity Target Field
ACTION_BAR.INF CANCEL ACTION_BAR.INF CANCEL
  OK   OK
  ADD   ADD
  DELETE   DELETE
COLUMN_BAR.INF FIRST    
  LAST    
MAIN FIRST    
  LAST    

Local Constants (Refer to Local Constants)

Name Expression Description
FORM_VERSION 01.000.000 To be incremented each time the component is changed.
VERIFY_DELETE   Signifies what validation needs to be done if the DELETE ley is pressed:
  • NONE - no validation (default)
  • INNER - check existence of inner/subordinate entities defined within the form's structure.
  • <tran_id> - the identity of a separate forms that checks for the existence of subordinate entities.

Component Variables (Refer to Component Variables)

Name Description
FORM_VERSION  
READ_COUNT  

Multi 2 - Maintain occurrences, single occurrence display

CT_MULTI2.gif

Description

This type of form is for those occasions where the contents of each occurrence is too large to fit into a single line, therefore the screen can only show one occurrence at a time.

Upon initial entry the form will perform an automatic retrieve of all available entries, therefore may not be suitable for a table with large volumes of data.

The user makes whatever modifications are required, then preses the OK button to update the database, terminate and return control to the previous form.

Buttons

OK Will commit all changes to the database (provided that all validation is successful), then exit and return control to the parent form.
CANCEL Will abandon all outstanding changes and return control immediately to the parent form.
ADD Will present the user with an empty occurrence so that a new entry may be input. The database will not be updated until the OK button is pressed.
DELETE Will delete the current occurrence from the screen, provided that no subordinate entries exist. The database will not be updated until the OK button is pressed.

Contents

Bound Objects

Source Entity Source Field Target Entity Target Field
ACTION_BAR.INF CANCEL ACTION_BAR.INF CANCEL
  OK   OK
  ADD   ADD
  DELETE   DELETE
MAIN FIRST    
  LAST    

Local Constants (Refer to Local Constants)

Name Expression Description
FORM_VERSION 01.000.000 To be incremented each time the component is changed.
VERIFY_DELETE   Signifies what validation needs to be done if the DELETE ley is pressed:
  • NONE - no validation (default)
  • INNER - check existence of inner/subordinate entities defined within the form's structure.
  • <tran_id> - the identity of a separate forms that checks for the existence of subordinate entities.

Component Variables (Refer to Component Variables)

Name Description
FORM_VERSION  
INIT_VALUES  
PARAMS  
READ_COUNT  

Multi 3 - Maintain MANY in a ONE-to-MANY relationship

CT_MULTI3.gif

Description

This type of form is used in a ONE-to-MANY relationship in order to maintain the occurrences of the MANY entity for a selected occurrence of the ONE entity.

Upon initial entry the form will retrieve an occurrence of the ONE entity using the primary key passed down by the parent form, then retrieve all associated occurrences of the MANY entity.

Buttons

OK Will commit all changes to the database (provided that all validation is successful), then exit and return control to the parent form.
CANCEL Will abandon all outstanding changes and return control immediately to the parent form.
ADD Will present the user with an empty occurrence of MANY so that a new entry may be input. The database will not be updated until the OK button is pressed.
DELETE Will delete the current occurrence of MANY from the screen, provided that no subordinate entries exist. The database will not be updated until the OK button is pressed.

Contents

Bound Objects

Source Entity Source Field Target Entity Target Field
ACTION_BAR.INF CANCEL ACTION_BAR.INF CANCEL
  OK   OK
  ADD   ADD
  DELETE   DELETE
COLUMN_BAR.INF FIRST    
  LAST    
ONE FIRST    
MANY FIRST    
  LAST    

Local Constants (Refer to Local Constants)

Name Expression Description
FORM_VERSION 01.000.000 To be incremented each time the component is changed.
VERIFY_DELETE   Signifies what validation needs to be done if the DELETE ley is pressed:
  • NONE - no validation (default)
  • INNER - check existence of inner/subordinate entities defined within the form's structure.
  • <tran_id> - the identity of a separate forms that checks for the existence of subordinate entities.

Component Variables (Refer to Component Variables)

Name Description
FORM_VERSION  
INIT_VALUES  
PARAMS  
READ_COUNT  

Multi 4 - Maintain MANY in a ONE-to-MANY-to-ONE relationship

CT_MULTI4.gif

Description

This type of form is used to maintain the details of what is sometimes referred to as a MANY-to-MANY relationship. This can only be supported with the introduction of linking (cross-reference) entity which then produces a pair of ONE-to-MANY relationships, as shown in Figure 1.

Figure 1 - A typical ONE-to-MANY-to-ONE relationship

multi_image001.gif

The primary key of the MANY entity is actually a combination of the primary keys from ONE A and ONE B. This means that only one occurrence of XREF can exist for a combination of primary key A and primary key B.

In this type of form the structure of the entities is as shown in Figure 2.

Figure 2 - Structure of the Multi 4 template

multi_image002.gif

Only occurrences of MANY can be modified - both OUTER and INNER are read-only.

Note that no fields from entity MANY are displayed as it contains nothing but foreign key fields whose values are obtained from the two related entities.

This function will probably need two versions:-

Upon initial entry this function will perform an automatic retrieve of entity OUTER using the primary key passed down from the parent form. It will then retrieve all associated occurrences of MANY followed by an occurrence of INNER using the foreign key on MANY.

Buttons

OK Will commit all updates to the database and return to the parent form.
CANCEL Will abandon all outstanding updates and return to the parent form.
ADD Will create a new occurrence of the MANY entity, with an empty INNER entity, and do one of the following, depending on the setting in local constant <AUTO_POPUP>:-
<popup_id> Automatically call the named popup form without allowing a profile to be entered so that the user may choose an occurrence of the INNER entity. If no entry is selected the empty occurrence will be deleted.
blank Wait for the user to press the popup_button.gif button (or activate the <detail> trigger), which allows a profile to be entered beforehand. If no entry is selected the occurrence will remain empty.

If an occurrence of INNER is selected which already has a link on MANY with the current OUTER it will be discarded with a DUPLICATE PRIMARY KEY message.

The database will not be updated until the OK button is pressed.

DELETE Will delete the current (highlighted) occurrence of the MANY entity from the screen. The database will not be updated until the OK button is pressed.

Contents

Bound Objects

Source Entity Source Field Target Entity Target Field
ACTION_BAR.INF CANCEL ACTION_BAR.INF CANCEL
  OK   OK
  ADD   ADD
  DELETE   DELETE
COLUMN_BAR.INF FIRST    
  LAST    
ONE FIRST    
MANY FIRST    
  LAST    

Local Constants (Refer to Local Constants)

Name Expression Description
FORM_VERSION 01.000.000 To be incremented each time the component is changed.
AUTO_POPUP   Refer to the ADD button.

Component Variables (Refer to Component Variables)

Name Description
FORM_VERSION  
PARAMS  
READ_COUNT  

Multi 4a - Maintain MANY in a ONE-to-MANY-to-ONE, with checkbox

CT_MULTI4A.gif

Description

This type of form is similar to MULTI 4, but retrieves occurrences of entity INNER before those of entity MANY. The component structure is shown in Figure 3.

Figure 3 - Structure of the Multi 4a template

multi_image003.gif

Upon initial entry this function will perform an automatic retrieve of entity OUTER using the primary key passed down from the parent form. It will then retrieve all available occurrences of INNER, then perform a lookup on MANY in determine the starting value of the SWITCH checkbox:-

Entries on entity MANY can be deleted by turning SWITCH from ON to OFF, or created by turning SWITCH from OFF to ON. This can be done either by clicking on the SWITCH checkbox or by double clicking on any other field within the line. This provides a very fast method of creating or deleting the link between ONE A and ONE B.

warning_symbol.gif As this type of component retrieves all available occurrences of the INNER entity it may not be wise to use it if this table contains a large volume of occurrences. Consider using template MULTI 4b instead.

Buttons

OK Will commit all pending updates to the database and return to the parent form.
CANCEL Will abandon all outstanding updates and return to the parent form.
STORE Will commit all pending updates to the database, but will remain within this function.

Contents

Bound Objects

Source Entity Source Field Target Entity Target Field
ACTION_BAR.INF CANCEL ACTION_BAR.INF CANCEL
  OK   OK
  STORE   STORE
COLUMN_BAR.INF FIRST    
  LAST    
OUTER FIRST    
INNER FIRST    
  LAST    
  SWITCH    

Local Constants (Refer to Local Constants)

Name Expression Description
FORM_VERSION 01.000.000 To be incremented each time the component is changed.
FKEY_OUTER   The name of the foreign key field on MANY which links to OUTER.
PKEY_OUTER   The name of the primary key field on OUTER.

Component Variables (Refer to Component Variables)

Name Description
FORM_VERSION  
PARAMS  
READ_COUNT  

Multi 4b - Maintain MANY in a ONE-to-MANY-to-ONE, with checkbox, with profile area

CT_MULTI4B.gif

Description

This type of function is similar to MULTI 4a, but in cases where there can potentially be a large number of occurrences of entity INNER it may be useful to offer the facility of processing the data in subsets by using the profile area.

Upon initial entry this form will perform an automatic retrieve using a profile with ACCESS SWITCH set to ON so that only those occurrences of INNER where there is a linking entry on MANY will be displayed.

info_symbol.gif The ACCESS switch in the profile area is a tri-state checkbox:-
ticked Will only show occurrences of INNER where an occurrence of MANY exists.
blank Will only show occurrences of INNER where an occurrence of MANY does not exist.
grey Will show occurrences of INNER whether an occurrence of MANY exists or not.

Entries on entity MANY can be deleted by turning ACCESS from ON to OFF, or created by turning ACCESS from OFF to ON. This can be done either by clicking on the ACCESS checkbox or by double clicking on any other field within the line.

Buttons

OK Will commit all pending updates to the database and return to the parent form.
CANCEL Will abandon all outstanding updates and return to the parent form.
STORE Will commit all pending updates to the database, but will remain within this function.
CLEAR Will clear the form of all data and place the cursor in the profile area.
RETRIEVE Will retrieve data according to the selection criteria in the profile area.

Contents

Bound Objects

Source Entity Source Field Target Entity Target Field
ACTION_BAR.INF CANCEL ACTION_BAR.INF CANCEL
  OK   OK
  STORE   STORE
  CLEAR   CLEAR
  RETRIEVE   RETRIEVE
COLUMN_BAR.INF FIRST    
  LAST    
OUTER FIRST    
INNER FIRST    
  LAST    
  ACCESS    
RETRIEVE_PROFILE FIRST    
  LAST    
  ACCESS    

Local Constants (Refer to Local Constants)

Name Expression Description
FORM_VERSION 01.000.000 To be incremented each time the component is changed.
FKEY_OUTER   The name of the foreign key field on MANY which links to OUTER.
PKEY_OUTER   The name of the primary key field on OUTER.

Component Variables (Refer to Component Variables)

Name Description
FORM_VERSION  
PARAMS  
READ_COUNT  

Multi 4c - Maintain MANY in a ONE-to-MANY-to-ONE, with navigation bar

CT_MULTI4C.gif

Description

This is the same as MULTI 4, but with the addition of a navigation bar.

Upon initial entry this function will perform an automatic retrieve of entity OUTER using the primary key passed down from the parent form. It will then retrieve all associated occurrences of MANY followed by an occurrence of INNER using the foreign key on MANY.

Buttons

OK Will commit all updates to the database and return to the parent form.
CANCEL Will abandon all outstanding updates and return to the parent form.
ADD Will create a new occurrence of the MANY entity, with an empty INNER entity, and do one of the following, depending on the setting in local constant <AUTO_POPUP>:-
<popup_id> Automatically call the named popup form without allowing a profile to be entered so that the user may choose an occurrence of the INNER entity. If no entry is selected the empty occurrence will be deleted.
blank Wait for the user to press the popup_button.gif button (or activate the <detail> trigger), which allows a profile to be entered beforehand. If no entry is selected the occurrence will remain empty.

If an occurrence of INNER is selected which already has a link on MANY with the current OUTER it will be discarded with a DUPLICATE PRIMARY KEY message.

The database will not be updated until the OK button is pressed.

DELETE Will delete the current (highlighted) occurrence of the MANY entity from the screen. The database will not be updated until the OK button is pressed.

Contents

Bound Objects

Source Entity Source Field Target Entity Target Field
ACTION_BAR.INF CANCEL ACTION_BAR.INF CANCEL
  OK   OK
  ADD   ADD
  DELETE   DELETE
COLUMN_BAR.INF FIRST    
  LAST    
ONE FIRST    
MANY FIRST    
  LAST    
NAVIGATION_BAR FIRST    
  LAST    

Local Constants (Refer to Local Constants)

Name Expression Description
FORM_VERSION 01.000.000 To be incremented each time the component is changed.
AUTO_POPUP   Refer to the ADD button.

Component Variables (Refer to Component Variables)

Name Description
FORM_VERSION  
PARAMS  
READ_COUNT  

Multi 5 - Maintain MANY in a ONE(a)-to-MANY-to-ONE(b), with dynamic list for ONE(b)

CT_MULTI5.gif

Description

This type of function is similar to MULTI 4, but caters for a more complex form of linking (XREF) entity, as shown in Figure 4.

Figure 4 - ONE(a)-to-MANY-to-ONE(b), with dynamic list for ONE(b)

multi_image004.gif

In this structure each occurrence of ONE B has its own set of occurrences on LIST B which identify those items where access can be switched ON or OFF (allowed or disallowed). Each occurrence of MANY (XREF) contains an indexed list of those items where the ACCESS ALLOWED switch has be changed from its initial setting.

The structure of this type of component is shown in Figure 5.

Figure 5 - Structure of the Multi 5 template

multi_image005.gif

When the database is updated the indexed list on each occurrence of MANY is rebuilt to contain only those items from LIST (B) where the ACCESS ALLOWED switch has be changed from local constant <INITIAL_SETTING>. If the list is empty then the occurrence of MANY is deleted.

Local constant <INITIAL_SETTING> can be set at compile time to one of the following values:-

Buttons

OK Will commit all updates to the database and return to the parent form.
CANCEL Will abandon all outstanding updates and return to the parent form.
ADD Will create a new occurrence of the MANY entity, with an empty INNER entity, and do one of the following, depending on the setting in local constant <AUTO_POPUP>:-
<popup_id> Automatically call the named popup form without allowing a profile to be entered so that the user may choose an occurrence of the INNER entity. If no entry is selected the empty occurrence will be deleted.
blank Wait for the user to press the popup_button.gif button (or activate the <detail> trigger), which allows a profile to be entered beforehand. If no entry is selected the occurrence will remain empty.

If an occurrence of INNER is selected which already has a link on MANY with the current OUTER it will be discarded with a DUPLICATE PRIMARY KEY message.

All data from LIST will be shown with each ALLOWED switch set to the value of local constant <INITIAL_SETTING>.

The database will not be updated until the OK button is pressed.

DELETE Will remove the current occurrence of MANY and its associated INNER from the screen. The database will not be updated until the OK button is pressed.
STORE Will commit all updates to the database but remain in the form.

Contents

Bound Objects

Source Entity Source Field Target Entity Target Field
ACTION_BAR.INF CANCEL ACTION_BAR.INF CANCEL
  OK   OK
  ADD   ADD
  DELETE   DELETE
  STORE   STORE
COLUMN_BAR.INF FIRST    
  LAST    
OUTER FIRST    
MANY N/A   N/A
INNER FIRST    
LIST ALLOWED    
  LIST_ITEM    

Local Constants (Refer to Local Constants)

Name Expression Description
FORM_VERSION 01.000.000 To be incremented each time the component is changed.
INITIAL_SETTING 0 or 1 The initial setting for the ALLOWED checkbox. 0 = OFF, 1 = ON.
AUTO_POPUP   Refer to the ADD button.

Component Variables (Refer to Component Variables)

Name Description
FORM_VERSION  
PARAMS  
READ_COUNT  

Multi 5a - Maintain MANY in a ONE(a)-to-MANY-to-ONE(b), with dynamic list for ONE(a)

CT_MULTI5A.gif

Description

This type of form is similar to MULTI 5, but caters for the situation where ONE B has to be the outer entity instead of ONE A.

The structure of this type of component is shown in Figure 6. You will notice that entity LIST is now inside entity OUTER instead of entity INNER. A dummy entity is placed inside INNER to hold the ACCESS ALLOWED switch and the LIST ITEM field.

Figure 6 - Structure of the Multi 5a template

multi_image006.gif

Buttons

OK Will commit all updates to the database and return to the parent form.
CANCEL Will abandon all outstanding updates and return to the parent form.
ADD Will create a new occurrence of the MANY entity, with an empty INNER entity, and do one of the following, depending on the setting in local constant <AUTO_POPUP>:-
<popup_id> Automatically call the named popup form without allowing a profile to be entered so that the user may choose an occurrence of the INNER entity. If no entry is selected the empty occurrence will be deleted.
blank Wait for the user to press the popup_button.gif button (or activate the <detail> trigger), which allows a profile to be entered beforehand. If no entry is selected the occurrence will remain empty.

If an occurrence of INNER is selected which already has a link on MANY with the current OUTER it will be discarded with a DUPLICATE PRIMARY KEY message.

All data from LIST will be shown with each ALLOWED switch set to the value of local constant <INITIAL_SETTING>.

The database will not be updated until the OK button is pressed.

DELETE Will remove the current occurrence of MANY and its associated INNER from the screen. The database will not be updated until the OK button is pressed.
STORE Will commit all updates to the database but remain in the form.

Contents

Bound Objects

Source Entity Source Field Target Entity Target Field
ACTION_BAR.INF CANCEL ACTION_BAR.INF CANCEL
  OK   OK
  ADD   ADD
  DELETE   DELETE
  STORE   STORE
COLUMN_BAR.INF FIRST    
  LAST    
OUTER FIRST    
MANY N/A   N/A
INNER FIRST    
LIST LIST_ITEM    
DUMMY ALLOWED    
  LIST_ITEM    

Local Constants (Refer to Local Constants)

Name Expression Description
FORM_VERSION 01.000.000 To be incremented each time the component is changed.
INITIAL_SETTING 0 or 1 The initial setting for the ALLOWED checkbox. 0 = OFF, 1 = ON.
AUTO_POPUP   Refer to the ADD button.

Component Variables (Refer to Component Variables)

Name Description
FORM_VERSION  
PARAMS  
READ_COUNT  

copyright.gif http://www.tonymarston.net