message "how do i return focus to entry Field".

netfreaky

New Member
Do I have put this in a frame?

for example: in the code, you want to set the cursor in the fill-in named "txtFILL", which is in frame "fraTest":

you need the following code:

Code:
APPLY "ENTRY":U TO txtFill IN FRAME fraTest.
RETURN NO-APPLY.
 

vexiteer

New Member
I have this code in a trigger and the return no apply seems to kill the trigger. Then basically I can't update my temp table. So if I put this validation in a frame I think it might work. I have multipile fields that I need refocus to if no data is entered into the fields.

field 1 no entry go back to field 1. Field 1 is okay go check out next field. Basically refouscing to the field that needs data.
 

timk519

New Member
I have this code in a trigger and the return no apply seems to kill the trigger. Then basically I can't update my temp table. So if I put this validation in a frame I think it might work. I have multipile fields that I need refocus to if no data is entered into the fields.

field 1 no entry go back to field 1. Field 1 is okay go check out next field. Basically refouscing to the field that needs data.

In addition to the citations already made, there's also

APPLY "ENTRY" TO widget-handle.

or any other event for that matter.

When a widget has focus, SELF = current-widget-handle, so this may do what you're looking for:

ON event OF field
DO:

RUN some-code(self, OUTPUT status).

IF NOT status THEN
RETURN NO-APPLY.
END.
 

tudorconstantin

New Member
on the LEAVE trigger of the field, do the validation and if the input is invalid do a:
APPLY "ENTRY":U TO <field-name>.
Here is no need to specify the frame in which the field is. When you have several fields, do the same thing on every LEAVE trigger of each field.
 

erick.rosales

New Member
For me doesnt work.. I'm using a Dynamic Fill-IN...

Here is my code...

IF p-objeto = "i-cedis" AND p-evento = "LEAVE" THEN DO:
FIND FIRST estabelec
WHERE estabelec.cod-estabel = wh-cedis:SCREEN-VALUE
NO-LOCK NO-ERROR.
IF NOT AVAILABLE estabelec THEN DO:
MESSAGE "No existe el Establecimiento como Cedis Valido."
VIEW-AS ALERT-BOX WARNING
TITLE "Error 1 - cdp/picd0705a".
wh-cedis:SCREEN-VALUE = "".
APPLY "ENTRY":U TO wh-cedis.
RETURN "NOK".
END.
END.

As you know... this code must be executed in other PERSITENT PROGRAM because I can't define a BLOCK CODE in a Trigger of a Dynamic Fill in...

Here is the code of the Fill In.

if valid-handle(wh-cedis) Then
delete widget wh-cedis.
create FILL-IN wh-cedis
assign frame = p-wgh-frame
DATA-TYPE = "Character"
FORMAT = "x(15)"
SIDE-LABEL-HANDLE = wh-txt-cedis
WIDTH = 15
HEIGHT = .88
ROW = 9.27
COL = 29.7
LABEL = "CEDIS atend:"
VISIBLE = yes
SENSITIVE = YES
NAME = "i-cedis"
TOOLTIP = "CPX - Cedis de Atendimientossss"
BGCOLOR = ?
TRIGGERS:
ON MOUSE-SELECT-DBLCLICK PERSISTENT RUN cdp\picd0705a.p (Input "i-cedis", Input "MOUSE-SELECT-DBLCLICK").
ON LEAVE PERSISTENT RUN cdp\picd0705a.p (Input "i-cedis", Input "LEAVE").
END TRIGGERS.
wh-cedis:LOAD-MOUSE-POINTER("image/lupa.cur":U).
 
Top