Consultor Eletrônico



Kbase P40080: How to automatically move input focus to the next widget in
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   01/09/2003
Status: Unverified

GOAL:

How to automatically move input focus to the next widget in the tab order when a user types the last allowable character in the current one?

GOAL:

How to automatically move the Application cursor to the next fill-in widget when the value in the current one is complete?

FIX:

The FORMAT attribute controls the number of characters that a user can enter in the widget. By default, if the user attempts to enter more characters than the number allowed in the widget, Progress beeps and ignores characters. You can use the AUTO-RETURN attribute to alter this behavior only if the DATA-ENTRY-RETURN attribute of the SESSION handle is TRUE.

If DATA-ENTRY-RETURN and AUTO-RETURN are TRUE and a user types the last character in a field, a LEAVE event occurs and input focus moves to the next widget in the tab order. If the widget is the last widget in the tab order, a GO event occurs for the current frame. This behavior is the same as pressing RETURN in the field when the DATA-ENTRY-RETURN attribute is TRUE. e.g.:

DEFINE VARIABLE FILL-IN-1 AS CHARACTER FORMAT "X(3)":U
LABEL "Fill 1"
VIEW-AS FILL-IN
SIZE 14 BY 1 NO-UNDO.

DEFINE VARIABLE FILL-IN-2 AS CHARACTER FORMAT "X(3)":U
LABEL "Fill 2"
VIEW-AS FILL-IN
SIZE 14 BY 1 NO-UNDO.

DEFINE FRAME fMain
FILL-IN-1 AT ROW 2.91 COL 20 COLON-ALIGNED AUTO-RETURN
FILL-IN-2 AT ROW 4.1 COL 20 COLON-ALIGNED
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
SIDE-LABELS NO-UNDERLINE THREE-D
AT COL 1 ROW 1
SIZE 80 BY 17.

ASSIGN
CURRENT-WINDOW:HEIGHT = 17
CURRENT-WINDOW:WIDTH = 80.
SESSION:DATA-ENTRY-RETURN = YES.
DISPLAY FILL-IN-1 FILL-IN-2
WITH FRAME fMain.
ENABLE FILL-IN-1 FILL-IN-2
WITH FRAME fMain.

WAIT-FOR CLOSE OF THIS-PROCEDURE.