Consultor Eletrônico



Kbase P15232: How to retain focus in a widget until data meets validation.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/25/2003
Status: Unverified

GOAL:

How to retain focus in a widget until data meets validation.

FACT(s) (Environment):

Progress/WebSpeed Versions

CAUSE:

If we preform a validation of the data within a widget we would like to disable the leave of this widget until validation requirements are met.

FIX:

By appending the validation code within your leave trigger we can accomplish this goal. The Command RETURN NO-APPLY will cause a widget to retain focus.

Example:

on LEAVE of FILL-IN-1 in FRAME {&frame-name}
DO:
IF FILL-IN-1:SCREEN-VALUE NE "X" THEN
DO:
MESSAGE "INCORRECT VALUE, Please try again" VIEW-AS ALERT-BOX.
RETURN NO-APPLY.
END.
END.

NOTE:
This will disable any and all attempts to leave the widget including closing the window. Make sure that you make allowances for other acceptable user decisions when implementing this code.