How to force the focus by program, to move or stay in a specific form element.
Use the NEXT FIELD instruction to force the focus to a specific field or screen record (list). The NEXT FIELD instruction expects a form field name.
DIALOG ATTRIBUTES(UNBUFFERED)
INPUT BY NAME p_cust ATTRIBUTES(NAME="cust")
...
END DISPLAY
DISPLAY ARRAY p_orders TO orders.*
...
END DISPLAY
ON ACTION go_to_header
NEXT FIELD cust_num
ON ACTION go_to_detail
NEXT FIELD order_lineno
...
END DIALOG
DIALOG ATTRIBUTES(UNBUFFERED)
...
COMMAND "print"
CALL print_order()
...
END DIALOG
DEFINE form ui.Form
...
DIALOG ATTRIBUTES(UNBUFFERED)
...
BEFORE DIALOG
LET form = DIALOG.getForm()
...
ON ACTION show_image1
CALL form.ensureElementVisible("image1")
...
END DIALOG