4D Blog

Home Product Easily customize the entry order of your dynamic forms

Easily customize the entry order of your dynamic forms

August 26, 2019

Product

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"
			]
		}
	]
}
Discuss

Tags Dynamic forms, v17 R6, v18

Latest related posts

  • June 16, 2025

    Generate, share and use web sessions One-Time Passcodes (OTP)

  • May 20, 2025

    Automatic Refresh of OEM Build Licenses

  • May 16, 2025

    New class to handle incoming TCP connections

Vanessa Talbot
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.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy