Apply "Entry" Event

Kalan

Member
Dear All,

I have the requirement to focus the cursor on specific fill-in field in the event of pressing "ENTER" key on another fill-in field. For ex. Fill-in-1, Fill-in-2 and Fill-in-3 text input fields. When user press "ENTER" key on Fill-in-1 then cursor should move into Fill-in-3 field to get the next input.

I have tried this with below code, but I can see control is triggerring the message alert from ON ENTRY event of Fill-in-3 but cursor remains in Fill-In-1. My expectation is cursor control should focus on Fill-in-3 field. Could someone please suggest me to acheive this?
ON RETURN OF FILL-IN-1 IN FRAME fMain
DO:
Apply "ENTRY" TO Fill-In-3.
END.

ON "ENTRY" OF Fill-IN-3 IN FRAME fMain
DO:
Message "Control is in Fill-in-3" view-as alert-box.
RETURN NO-APPLY.
END.

Thanks.
 

GregTomkins

Active Member
Try looking at the FOCUS handle... I would have guessed that APPLY ENTRY would work, but my time with the Progress Win32 GUI ended a couple of years ago.
 

TheMadDBA

Active Member
You could always just adjust the tab order. Or change your code to be like this instead:

ON RETURN OF FILL-IN-1 IN FRAME fMain
DO:
Apply "ENTRY" TO Fill-In-3.
RETURN NO-APPLY.
END.

ON "ENTRY" OF Fill-IN-3 IN FRAME fMain
DO:
Message "Control is in Fill-in-3" view-as alert-box.
/* RETURN NO-APPLY. */
END.
 

Kalan

Member
Many thanks to TheMadDBA. It works based on your suggestion.

@Tomkins, If possible, could you please suggest me how to use focus handle? I tried this below code, but I am missing something on this. - Thanks.

ON RETURN OF FILL-IN-4 IN FRAME fMain /* Fill 4 */
DO:
DEFINE VAR fHandle AS HANDLE NO-UNDO.
fHandle = Fill-In-6:Handle.
FOCUS:NAME = Fill-In-6.

END.
 

GregTomkins

Active Member
That was probably a bad suggestion. I looked in the doc quickly (my apologies for not doing that in the first place) and while vague, it implies that it's read-only, eg. you can use it to find out where focus is, but not to set it. In any case, I believe TheMadDBA is, despite the misleading user name, far more capable than I when it comes to Progress GUI, so you should listen to him (or her) ;)
 
Top