Here are 2 very common developer needs: 1. Depending on the user criteria, you want to rearrange the objects in the form. – 2. Depending on the selected item in a list, you want to show, hide or move the objects in the form.
In all theses cases, you need to change the tab order of the form objects. Now in 4D v16 R4, you can modify the tab order at runtime by programming. To do so, 2 new commands have been created: FORM SET ENTRY ORDER and FORM GET ENTRY ORDER.
Get the tab order
This command returns the current tab order for the current page or a specified page in a form object name array.
Here is the command syntax:
FORM GET ENTRY ORDER ( form object name array ; {page number} )
Set the tab order
This command allows to define the tab order for the current page or a specified page.
Here is the command syntax:
FORM SET ENTRY ORDER ( form object name array ; {page number} )
When you execute the tab order during the application runtime, you overwrite the tab order defined in the design form.
Note: A form page includes page 0 objects, inherited form objects, specified page subform objects and specified page objects. The entry order of a subform is defined in the subform itself. For example, you call the FORM SET ENTRY ORDER command in the “On Load“ event of the subform.
Example
If you want to try yourself, just download our example:
Documentation
For more details, please refer to the documentation: