This chapter contains the following topics:
A search & select form is used to select a single predetermined field from a record in a predetermined file. Search & Select forms return only one value to the calling form, based on the dictionary alias. If no data dictionary (DD) alias matches the value, the first value from the data structure is returned.
These events can occur on the search & select form during runtime:
Dialog is Initialized
Post Dialog is Initialized
Grid Record is Fetched
Last Grid Record Has Been Read
Write Grid Line-Before
Write Grid Line-After
XAPI Subscribe Event
This section discusses how runtime processes search & select forms. A search & select form should be attached as a visual assist only to data items that have the same data type as the form data structure element.
This section discusses form-level runtime processing only. Much of the runtime processing for the search & select "form" actually occurs on the level of the grid control, however.
When a search & select form is called, runtime initializes these items in this order:
Error handling process
Business view columns (BC)
Form controls (FC)
Event rules (ER) structures
Next, it performs these actions in this order:
Create the tool bar.
Load form interconnection data into corresponding BC and filter fields, if any.
Fire Dialog is Initialized.
Fire Post Dialog is Initialized.
If the Automatically Find On Entry option is selected, begin detail data selection and sequencing in the grid control.
If runtime does not encounter errors, this step leads to the population of the grid control, ultimately.
The Find button is a standard button on headerless detail forms that appears by default. When the user clicks it, runtime fires the Button Clicked event. If no errors exist in the filter fields, runtime performs data selection and sequencing for the grid control. After reloading the grid with the fetched data, runtime fires the Post Button Clicked event.
The Select button is a standard button on search & select forms that appears by default. When the user clicks it, runtime fires the Button Clicked event. If no errors occur, runtime writes the values from the selected row to the BC and fires the Post Button Clicked event. Then it fires the End Dialog event and initiates the dialog close process.
The Close button is a standard button on search & select forms that appears by default. When the user clicks it, runtime fires the Button Clicked and Post Button Clicked events in immediate succession. If no errors occur, runtime attempts to close all of the modeless child forms, if any exist. If any of these child forms cannot be closed, the Close button process is terminated. Otherwise, runtime fires the End Dialog event and initiates the dialog close process.
Search & Select can be closed either by the user (typically by clicking the Select or Close buttons) or by the system. After performing any control-level close processing that might need to occur, runtime closes the form. If the event has not already occurred, runtime fires the End Dialog event. Then it performs these tasks in this order:
Load form interconnect data from BC for database commit.
Terminate error handling.
Free all form structures.
Destroy the window.