Define the tab order by programming

Automatically translated from English

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.

4D UI: tab order by programming

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:

Example Database

Documentation

For more details, please refer to the documentation:

Vanessa Talbot

• Product Owner •

Vanessa Talbot joined 4D Program team in June, 2014. As a Product Owner, she is in charge of writing the user stories then translating it to functional specifications. Her role is also to make sure that the feature implementation delivered is meeting the customer need.

Since her arrival, she has worked to define key features in 4D. She has worked on most of preemptive multi-threading new features and also on a very complex subject: the new architecture for engined application. Vanessa has a degree from Telecom Saint-Etienne. She began her career at the Criminal Research Institute as a developer for the audiovisual department. She has also worked in media and medical fields as expert in technical support, production as well as documenting new features.