Easily customize the entry order of your dynamic forms

Automatically translated from English

The power of dynamic forms was introduced with 4D v16 R6, allowing you to build your forms on the fly by building them in an object or loading them from a text file. This is very convenient in a world where forms are frequently changed to meet an application’s needs.

In 4D, the entry order typically follows a z order for both binary and dynamic forms. With 4D v17 R6, you can now define an entry order that’s not necessarily associated with the z order. 

For each page in your form definition, you have the “objects” attribute containing a list of form elements arranged according to the z order. A new “entryOrder” attribute has been added to let you specify your own customized entry order. If this attribute is undefined, 4D will use the z order (the order defined in the “objects” attribute).

Here’s an example of a dynamic form with two input fields and a button:

// Create inputs and button
$text1:=New object("type";"input"; "top";20; "left";140; "width";100; "height";18)
$text2:=New object("type";"input"; "top";20; "left";20; "width";100; "height";18)
$button:=New object("type";"button"; "text";"OK"; "top";60; "left";140; "width";100; "height";20)

// Create entry order collection
$entryOrder:=New Collection("text2";"text1")

// Create page with form objects and entry order
$page:=New object("objects";New object("text1";$text1; "text2";$text2; "button";$button); "entryOrder";$entryOrder)

// Create form
$form:=New object("pages"; New collection(Null;$page); "windowTitle";"My form"; "rightMargin";20; "bottomMargin";20)

// Load the form
$w:=Open form window($form)
DIALOG($form)

This can be represented as:

{
	"pages": [
		null,
		{
			"objects": {
				"text1": {
					"type": "input",
					"top": 20, "left": 140,
					"width": 100, "height": 18,
					"events": ["onClick"]
				},
				"text2": {
					"type": "input",
					"top": 20, "left": 20,
					"width": 20, "height": 18,
					"events": ["onClick"]
				},
				"button": {
					"type": "button",
					"text": "OK",
					"top": 60, "left": 140,
					"width": 20, "height": 20,
					"events": ["onClick"]
				}
			},
			"entryOrder": [
				"text2",
				"text1"
			]
		}
	]
}
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.