Editing functions are functions, which are available in -> Mask-Edit state to enter search terms in the search line (Query mode) or to process field contents in the edit line (Insert mode, Update mode). You can trigger edit functions mask- and mode-specifically via items in the -> Edit Menu or via -> Edit buttons and - for all masks - via -> Events in Mask-Edit state (MAS). Additionally, the allocation of specific mask-field attributes influences the edit functions in the mask (e.g. access to fields). Generated default masks automatically offer a wide range of frequently required edit functions. You can modify or extend these functions in application-specific copies of these masks.
All standard functions for cursor movement and editing characters in masks are contained in DataView as system events in MAS state and neither have to be created or edited.
If you want to provide additionally as edit buttons or in the Edit menu, you can use the event macros @NEXT-FIELD, @PREVIOUS-FIELD, @NEXT-LINE, @START-FIELD, @FIRST-FIELD, @END-FIELD, @LAST-FIELD for the cursor movements and the event macros @CLEAR-FIELD, @DELETE-LINE for deleting characters. They must be called with the help of the auxiliary userexit evt_cal_mac for items and buttons (Attention. Macros as parameters are specified including @).
In generated default masks only the item Delete field content will be available in the automatically installed Edit menu or as button in the automatically installed Edit button area.
Changing the events for cursor movements or for deleting characters should be an exception. If you do that please note that the keys [Home], [End] and [Delete] are hard-coded at the client-side and that it is not possible to define a user-specific assignment with other functions in MAS state.
For copying, cutting and pasting field contents the client macros CUT, COPY and PASTE are available. It can be only called for items and buttons via the auxiliary userexit cch_cal_mac (Attention. Macros as parameters are specified without @). Please note that PASTE operations do not set off any field triggers, because the field has already been entered.
In DataView the key-combinations [Ctrl+X], [Ctrl+C], [Ctrl+V] are hard-coded on the client-side for CUT, COPY and PASTE. There are no system events for that in the event data list and, thus, you cannot user-specifically reassign these keys in MAS state. In generated default masks the items Cut, Copy and Insert are available at the automatically installed Edit menu.
You can toggle between overwrite and insert mode for items and buttons with the help of the event macros @INSERT-MODE and @OVERSTRIKE-MODE. They are called via the auxiliary userexit evt_cal_mac (Attention. Macros as parameters are specified including @). The additional event macro @SWITCHMODE is available to allow you to alternatingly change the mode with a key.
In DataView the key [Insert] is hard-coded at the client-side to be used for changing the mode and the key combination [Ctrl+A] in MAS state is defined as system event. In generated default masks the items Overstrike mode, Insert mode are available in both the automatically installed Edit menu as well as the corresponding buttons in the automatically installed button area.
The DTV client stores the overwrite/insert-mode for each mask within one session. This means, that in one mask the insert mode can be active, while in another mask the overwrite mode is set. Each newly opened mask within one session will take the mode which was last set by the user. The mode last set by the user is stored in the Windows registry. When a new session is started, each newly opened mask will be in this mode until it is changed the next time.
Changes while editing field entries can be undone or redone. To install these functions the event macros @UNDO-BACKWARD and @UNDO-FORWARD can be used. For items and buttons they are called with the auxiliary userexit evt_cal_mac (Attention. The macros are specified as parameter including @).
The macro @UNDO-BACKWARD undoes changes after editing field entries. A one-time undo will restore the state before the field was entered. Undo actions are possible as often as required to restore the state before changing into Mask-Edit state. The macro @UNDO-FORWARD successively undoes all undone changes to field entries, i.e. restores them.
In DataView the key-combinations [Ctrl+Z] and [Shift+Ctrl+Z] are defined as system events for Undo operations in MAS state. In generated default masks the items Undo and Redo are available in the Edit menu as well as in the corresponding buttons of the automatically created button area.
Note! Undo/Re-Undo items in Edit menus only work if the corresponding Undo/Re-Undo buttons are contained in the Edit button area. If these buttons do not exist there, DataView will automatically switch off the Undo/Re-Undo buffer in order to save resources.
At all fields with a virtual width larger than the visible one (entries in the fields Wid/V and Width of the mask-field relation) you can open an edit window with the event macro @POP-FIELD in order to edit long field entries more comfortably. For items and buttons it is called with the auxiliary userexit evt_cal_mac (Attention. Macro specified as parameter including @). You should provide this edit window especially in forms, because - as opposed to lists - the field width cannot be interactively changed there.
In created default masks you can open the edit window via maximise field size button in the automatically installed button area or via [Ctrl+P].
The edit window can be left via the X-button or [Esc]. The X button will disappear if the mouse is moved to the left in the input field. It will reappear as soon as the mouse touches the upper right border.
The client variable DATAVIEW_LTCP can be used for Longtext fields to install a counter that displays the current character position, the current character number and the maximum possible number of characters under the Edit window.
If DataView identifies the active field as a -> Longtext field (virtual width in the mask larger than 255 characters), an alternative text editor defined by the client environment variable DATAVIEW_CEDT will be automatically opened as longtext editor, as soon as the edit window is invoked as described above (e,g, . MS Editor or MS WordPad). If the variable is not defined, the edit window described above will be opened.
Any special rules for editing field contents do not exist any longer. For Agile EDB version 6.1 and higher it is no longer necessary to enter at least one formatting (line break) within the first 255 characters.
Information on multilingual mask fields can be found in the chapter -> Language Management.
The field access in Mask-Edit state is controlled with the help of the access flags A, U, I, Q of the mask-field relation. The flags allow mode-dependent or mode-independent field access. For instance you could use them to allow a significant number field to be written to when a new item record is entered (Insert mode), but prevent any changes to that number when the record is updated later (Update mode). Additionally you can make fields invisible in a mask. The following access identifiers can be selected in the access flags:
When generating default masks the access for regular fields will be mode-independently set to Write (A = w). A field which is defined as non-zero field in the table-field relation, automatically becomes a Mandatory field for all modes (A = m). If the field was also set the be unique and indexed (fields Index and U), the field will automatically get mode-specific access identifiers in the mask. These are A = *, I = m, U = r, Q = w. Thus a generated default mask is always designed in a way to force all field entries required to ensure uniqueness when a new field is entered, but not to allow them to be changed later.
Using the standard field userexit cch_skp_fld you can skip fields while editing. You install this userexit at the Pre_Field trigger of the field to be skipped. If a user tries to enter the field with the write cursor, the cursor will skip the field and is automatically positioned in the next one. This is a simple way to lock individual fields without changing the access identifiers.
Fields positioned outside of forms (negative column position) are automatically skipped. It is not required to apply cch_skp_fld.
Selection tools at fields are either -> choice boxes, -> radio buttons (in forms only) or the -> modal window. Choice boxes and radio buttons are usually required to import text entries into a field, while modal windows are used for data of dependent elements in relation-, type-, or link-lists.
You link a selection tool with a field by entering the object name in the Menu field of the mask-field relation and the selection tool type in the Menu Type field.
Note! Field selection tools of the type M (menu) and L (list box) defined before version 4.1 will be automatically displayed as choice boxes in version 4.1 or later. The owed entries M and L in the menu type field remained unchanged. However, they are not supported as a new entry any longer.
The modal window is a special -> selection tool at the field. It carries any mask which you define. In this mask users can select records and import them into the input line (edit line or search line) of the calling mask. In this process all those field contents (contained in the selection mask, visible or invisible) of the selected record are copied into the calling mask which are in attribute fields with the same names. It is especially useful to install modal windows at master attribute fields in relation lists (refine/aggregate lists). There they simplify the -> creation of relations by allowing users to quickly select child elements and importing them into the relation list. After that only possible relation attributes have to be assigned.
You link a modal window with a field by entering the name of the desired mask into the Menu field of the mask-field relation (for lists in the form: [L>]list name, for forms in the form: F>form name) and selecting the selection tool type W in the Menu Type field.
Fields with installed modal window can be identified at their arrow-button. It appears when the field is entered with the write cursor. If the modal window is opened, DataView will shift the mask displayed into Query mode of Mask-Edit state. You can immediately search for records in the search line. Data are individually imported into the calling mask by selecting them and activating Import entry in the context menu. Then the modal window will automatically close.
Basically the mask in the modal window offers exactly the mask functions you install at it. So if you use a copied and slightly adapted default master mask, users will be allowed to create or edit child elements there. Please observe the limitation that DataView will ignore any defined context menu and replace it by default menus. However, you can install your own context button area.
Note! In modal Windows several records can be selected, for instance in order to edit them all at once a comfortable way. If immediately after that the calling mask is taken over, Dataview will only use the first selected record.
Example: The figure shows a combined item form with opened suppliers list. It maps the 1:n-relation Item-Supplier in the data model of our firm meditronic. At the supplier number field in the Supplier Data refine list a modal window is installed. It shows the suppliers master list. In order to assign the new supplier Feinoptik GmbH (child element) to the laparoscope displayed in the header form, this supplier will be located in the modal window, selected and imported into the Supplier Data refine list. In this example, supplier number and firm name would be automatically copied into the input line by DataView. So only the required relation attributes Purchase Price and Deadline would have to be entered, before the record could be stored.
DataView automatically installs the modal window at the displayed (significant) master attribute field (in the example the supplier number field) in automatically generated default refine/aggregate lists or default type masks. In case of default refine/aggregate lists it contains the default master list created for the child entity. In case of default type masks it contains the default master list. If you later modify an application-specific mask copy so that it displays more master attribute fields in the relation or type mask (e.g. also the firm name), you could explicitly install the modal window at this field field, too.
In link masks you have to manually install modal windows for selecting dependent elements, e.g. at a displayed master attribute field of table 1 for a 1:1 or 1:n link from table 1 to table 2 (valid for display of linked data in one single list, also confer -> display of linked data in masks).
Any checks of the entries taken from the modal window or settings of the mode-specific access to the modal window itself can be done at the calling field. Detailed information on that can be found in -> Procedures for Creating Relations.
With the help of check strings you can check the syntax of field entries, e.g. whether certain rules were observed when entering an item number. Check strings themselves consist of individual check characters. They force the entry of certain characters at certain positions in a field. Check strings for fields are defined mask-independently in the Check String field of the field master. If a field is displayed in several masks you can mask-specifically overwrite this check string. This is done in the Check String-M field of the mask-field-default relation. A check string can consist of the following check characters:
Attention! The check string may not contain spaces followed by further check characters.
Note! A check string is no validation, but only an assistance for data input at a certain cursor position. This assistance is executed on the client and does not become active before the first character of the field has been edited. Especially, a check string cannot be used to enforce a minimum length.
Example: In order to force item numbers to be entered in the form R2.4 c, the check string RNNN.NNN0a would have to be entered.
Using the standard field userexit cch_chk_rng treshold1 treshold2 at the Post_Field trigger of a field you can check whether the field entry specified is within a certain range of values. The threshold value parameters must by type-compatible. If an empty entry is passed as one of the parameters, DataView will only check for the upper or lower value. If the field value is not within the range specified, DataView will output a message. The field cannot be left before a valid entry is specified.
Example: for specifying ranges of values:
You can assign default values to fields when you create new records. Such defaults are mask-independently defined in the Default Value field of the field master. When the field is displayed in several masks, you can mask-specifically overwrite this. This is done in the Default Value-M field of the mask-field-default relation. The default value must be type-compatible to the field. Whether the default value can be changed depends on the settings for the -> field access.
By entering the macro @DEFAULT (DEFAULT stands for variable name) a field can also be assigned the current value of a -> default variable. In this case you must also make be sure that variable type and field type correspond. In case of user-specific assignment of variables the field will get a default value depending on the current user.
In addition to using application-specific variables you can use this method to assign the current user, the current group or the date to a field using @USER, @GROUP, @TODAY.
For BLOB fields used to -> display images in forms a default graphics can be used by entering a graphics filename.
Attention! The field default assignment must correspond to any defined check character (from the left to its end). Especially no spaces my be assigned to mid-positions with the check character "N".
You can enter a mask-independent explanatory text for the field in the Description field of the field master. If the field is displayed in several masks, you can enter a mask-specific text in the Description-M field of the mask-field relation. The text automatically appears in the footer line of the mask when the field is entered. It is useful to enter a text describing the field in closer detail or informing about possible entries.