4D v14.3DISPLAY SELECTION |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
DISPLAY SELECTION
DISPLAY SELECTION
DISPLAY SELECTION displays the selection of aTable, using the output form. The records are displayed in a scrollable list similar to that of the Design environment. If the user double-clicks a record, by default the record is displayed in the current input form. The list is displayed in the frontmost window. To display a selection and also modify a record in the current input form after you have double-clicked on it (as you do in the Design environment window), or via the Enter in list mode, use MODIFY SELECTION instead of DISPLAY SELECTION. After DISPLAY SELECTION is executed, there may not be a current record. Use a command such as FIRST RECORD or LAST RECORD to select one. The selectMode parameter is used to set the possibilities for selecting records in the list using the mouse. You can pass one of the following constants of the “Form Parameters” theme in this parameter:
The enterList parameter lets you authorize the “Enter in List” mode for the displayed list. This lets the user select and modify the record values directly in the output form. Pass True to enable this mode or False to disable it. By default, if you do not pass the enterList parameter, the “Enter in List” mode is disabled. Note: The OBJECT SET ENTERABLE command can be used to enable or disable the Enter in list mode on the fly. If the selection contains only one record and the first optional * is not used, the record appears in the input form instead of the output form. If the first optional * is specified, a one-record selection is displayed, using the output form. If the first optional * is specified and the user displays the record in the input form by double-clicking on it, the scroll bars will be hidden in the input form. To reverse this effect, pass the second optional *. Custom buttons may be put in the Footer or Header area of the output form in order to terminate the execution of the DISPLAY SELECTION command. You can use automatic Accept or Cancel buttons to exit, or use an object method that calls ACCEPT or CANCEL. When an output form called by the DISPLAY SELECTION command has no buttons, only the Escape (Windows) or Esc (Mac OS) key can be used to exit the list. During and after execution of DISPLAY SELECTION, the records that the user highlighted (selected) are kept in a set named UserSet. The UserSet is available within the selection display for object methods when a button is clicked or a menu item is chosen. It is also available to the project method that called DISPLAY SELECTION after the command was completed. The following example selects all the records in the [People] table. It then uses DISPLAY SELECTION to display the records, and allows the user to select the records to print. Finally, it selects the records with USE SET, and prints them with PRINT SELECTION: ALL RECORDS([People]) ` Select all records See example #6 for the Form event command. This example shows all the tests you may need to check in order to fully monitor the events that occur during a DISPLAY SELECTION. To reproduce the functionality provided by, for example, the Records menu of the Design environment when you use DISPLAY SELECTION or MODIFY SELECTION in the Application environment, proceed as follows: a. In the Design environment, create a menu bar with the menu commands you want, for example, Show All, Query and Order By. b. Associate this menu bar (using the “Associated menu bar” menu in the form properties dialog box) with the output form used with DISPLAY SELECTION or MODIFY SELECTION. c. Associate the following project methods to your menu commands: ` M_SHOW_ALL (attached to menu item Show All) You can also use other commands, such as PRINT SELECTION, QR REPORT, and so on, to provide all the “standard” menu options you may want each time you display or modify a selection in the Application environment. Thanks to the Current form table command, these methods are generic, and the menu bar they support can be attached to any output form of any table. |
PROPERTIES
Product: 4D
HISTORY
Modified: 4D 2004 SEE ALSO
Form event ARTICLE USAGE
4D Language Reference ( 4D v14 R2) Inherited from : DISPLAY SELECTION ( 4D v12.4) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||