21 Understanding Edit Controls

This chapter contains the following topics:

21.1 Edit Controls

An edit control is a text field on a form. All form types can contain edit controls except message forms. Two types of edit controls are available. The first type is commonly referred to as a database field. It is associated with an item in the business view (BV) and through that connection to a specific data dictionary (DD) item. Database fields represent a field in a database record. The second type of edit control is commonly referred to as a DD field, and it also has a connection to a specific DD item.

Within the realm of database fields an additional distinction between filter fields and nonfilter fields exists. Database fields are nonfilter fields by default. Filter fields are used to alter the selection criteria of a database fetch. A filter can have a comparison type of equal, not equal, less than, less than or equal to, greater than, or greater than or equal to. A filter can be marked such that a wildcard (*) displays when the filter is not included in the selection.

The storage for the value of the edit control is based on the type of its associated DD item (such as numeric, string, character). An edit control is affected by the properties of the associated DD item. For example, if an edit control is associated with a DD item of type string with a length of thirty, the edit control will not permit more than thirty characters to be typed into the field.

Edit controls are generic input fields and have no associated text. You must associate edit controls with data items.

If you associate an edit control with a data item from the BV associated with the form, then the value entered by a user at runtime updates the table. If you associate an edit control with a data item not associated with the BV, then the value entered at runtime is for display only. However, you can make a field read-only for BV data items by enabling the Read Only property. You can also associate an edit control with a DD item with a user-defined code (UDC).

Edit controls have a Type Ahead feature. When a user enters a character in the field, the system searches a history list for a match. If a match exists, it appears in the field and is highlighted. This feature is particularly useful for data entry work because it can reduce the amount of typing required. A user can enable or disable Type Ahead editing in JD Edwards EnterpriseOne. Additionally, the Type Ahead capabilities of the browser (such as Internet Explorer) must be enabled as well. Type Ahead is disabled for double-byte languages and multiline edit controls.

As you add controls to the form, you can indicate how the runtime engine filters the incoming records from the database. For example, if the find/browse form has two controls on which you want to filter, the resulting SQL statement that you generate will have an AND condition for each condition. For example, if you have Search Type and Alpha Description as the controls on the form, the filter criteria for Search Description should be >= and the Search Type control should be =. If a user types D and puts a V in the Search Type field, this is the resulting SQL statement:

SELECT * FROM F0101 WHERE (ABAT1 = V AND ABDC LIKE D%) ORDER BY ABAN8 ASC

You might also want to apply filters to edit controls when records need to fall between two values. In this case, you use a range filter. For example, in distribution, a status is assigned to each line of the order. One status is the current status and the other status is the next status. In this example, you filter records that are greater than or equal to the present status and less than or equal to the next status. You drop one value, filter the value, and then drop the next value.

A consideration when using the Required Field flag with edit fields is that, if the required field indicator should be displayed in the application, you must check the Required Field property for the edit field and then connect static text to it. Be sure to size the connected static text box appropriately to allow for the "required" indicator to be appended to the end of the text, and also to allow for translations. If you do not connect static text to the edit field, runtime does not display the required field indicator in the application.

To connect static text to the edit field, select the edit field and the label. Then select Edit, Reconnect. To disconnect the static text from the edit field, select them and then select Edit, Disconnect.

21.2 Edit Control Events

These events can fire on an edit control:

  • Control is Entered

  • Visual Assist Button Clicked

  • Post Visual Assistant Clicked

  • Control is Exited

  • Control is Exited/Changed-Inline

  • Control is Exited/Changed-Asynch

21.3 Edit Control Runtime Processing

This section discusses how the runtime engine processes the edit control.

21.3.1 Control is Entered

The control can acquire focus either through a user action, such as by pressing the Tab key or clicking it with the mouse, or through a system command. When the control acquires focus, runtime fires the Control is Entered event.

21.3.2 Control is Exited

When the user leaves the control (such as by pressing the Tab key), the system validates the control and saves the value to memory. A number of events are fired during this process.

Data validation consists of ensuring that the value meets any established criteria for the DD item upon which it is based, including size, type, and so forth. Additionally, runtime compares the current value of the control with the value of the control before it started the exit process. If the value has changed, then it fires two additional events.

21.4 Edit Control System Functions

This section discusses system functions for edit controls, which reside in the Control folder.


Set Edit Control Color

Use this system function to set the background color for the edit control.

Parameters

Control

Input, required. The FC to affect.

Color

Input, required. The color to which to set the control. Double-click <Pick Color> to select a specific color. Otherwise, set the parameter to <Pick Color> or the default color (<Reset Color>).


Set Edit Control Font

Use this system function to set the font and font characteristics (for example, typeface and color) for an edit control.

Parameters

Control

Input, required. The FC to affect.

Font

Input, required. The font and font characteristics to apply. Double-click <Pick Font> to select specific settings. Otherwise, set the parameter to <Pick Font> or the system default settings (<Reset Font>).