Dynamic Forms are forms whose structures are defined in either a .json file or a 4D object. They are regenerated each time they are run and provide a superior level of flexibility. A few notable advantages include:
Usability
straightforward updates
dynamic user modifications
easy reuse
faster searching
Portability
simplified sharing
can be stored in source control
Every object defined in a dynamic form, including the form itself, has one or more properties.
comply with the JSON schema. The 4D JSON form schema can be found in the 4D program folder at: Resources/formsSchema.json. It is your responsibility to verify the validity of the .json form file. See the JSON Validate command.
be in files with a ".json" file extension.
be stored inside the application package, relative to the structure file.
Notes:
Comments within .json files must be contained within the "comments" property. Standard coding characters for comments (i.e., "//", "/*", "'", etc.) will render the file invalid.
All file paths can be relative or absolute. They must use '/' as path delimiter and are resolved the following way:
A relative path must not start with '/'. It is resolved relatively to the JSON document where the path string has been found,
An absolute path starts with '/'. For security reasons, only "/RESOURCES" is accepted as absolute path and designates the current database resources folder. For example, "/RESOURCES/templates/myfile.json" points to the file "myfile.json" located in the current database resources folder.
Notes:
The name resolution is case sensitive.
4D does not resolve a path to a .json file located over the network (starting with "http/https").
If the path is incorrect or the file is not valid per the JSON schema, an error will be generated.
Dynamic forms can contain JSON pointers. JSON pointers are automatically resolved when you call a 4D command that accepts a dynamic form as parameter (.json file path or 4D object):
CSS file path(s) provided as a string, a collection of strings, or a collection of objects with "path" and "media" properties
form
entryOrder
collection
Collection of form object names defining the entry order (the order in which form objects are sequentially highlighted when the user presses Tab or Ctrl/Cmd+Tab). If this property is not defined, the default entry order (based upon the object definition order for the page) is used
Markers specify precise locations on the vertical ruler of the form. Used mainly in output forms, they control the listed information and set header, break, detail and footer areas of a form.
The "events" property accepts a JSON array (collection) of strings or numbers. To call an event, enter the event's name or value (see form event constant values). For exemple, "events":["onLoad"]) or "events":[1]
Property
Type
Description
Possible Values
Objects Supported
events
String array or number array
The event(s) to listen for in order to trigger an action.
When a splitter object has this property, other objects to its right (vertical splitter) or below it (horizontal splitter) are pushed at the same time as the splitter, with no stop.
Enables automatically adding a value to a list stored in memory when a user enters a value that is not found in the choice list associated with the object.
TRUE / FALSE
combo, list box column
choiceList
list
Associates a choice list with a column of a list box.
varies
input, dropdown, combo, list box column
currentItemSource
string
The last selected item.
Object expression
list box
currentItemPositionSource
string
The position of the last selected item.
Number expression
list box
dataSource
string, or string array for hierarchical listbox column
Specifies the source of the data.
A 4D variable, field name, or an arbitrary complex language expression.
tab, input, button, checkbox, radio, dropdown, combo, write, subform, plugin, splitter, buttonGrid, progress, ruler, spinner (Asynchronous progress bar), stepper, list, pictureButton, picturePopup, list box column, list box header, list box footer, list box, view
Controls the way dates appear when displayed or printed. Must only be selected among the 4D built-in formats.
"systemShort", "systemMedium", "systemLong", "iso8601", "rfc822", "short", "shortCentury", "abbreviated", "long", "blankIfNull" (can be combined with the other possible values)
input, list box column, dropdown, combo, list box footer
numberFormat
string
Controls the way numbers appear when displayed or printed.
Numbers (including a decimal point or minus sign if necessary)
input, dropdown, combo, ruler, progress, list box column, list box footer
pictureFormat
string
Controls how pictures appear when displayed or printed.
input, combo, dropdown, list box column, list box footer
timeFormat
string
Controls the way times appear when displayed or printed. Must only be selected among the 4D built-in formats.
"systemShort", "systemMedium", "systemLong", "iso8601", "hh_mm_ss", "hh_mm", "hh_mm_am", "mm_ss", "HH_MM_SS", "HH_MM", "MM_SS", "blankIfNull" (can be combined with the other possible values)
input, dropdown, list box column, list box footer
truncateMode
string
Controls the display of values when list box columns are too narrow to show their full contents.
"withEllipsis"; "none"
list box column, list box footer
visibility
string
Allows hiding the object in the Application environment.
Allows setting a list whose values cannot be entered in the column. If an excluded value is entered, it is not accepted and an error message is displayed.
varies
input, combo, list box column
max
string / number
The maximum allowed value. For numeric steppers, these properties represent seconds when the object is associated with a time type value and are ignored when it is associated with a date type value.
varies
input, progress, ruler, stepper
min
string / number
The minimum allowed value. For numeric steppers, these properties represent seconds when the object is associated with a time type value and are ignored when it is associated with a date type value.
varies
input, progress, ruler, stepper
requiredList
list
Allows setting a list where only these values can be inserted. When a required list is defined, keyboard entry is no longer possible.
Similar to a standard button except that it has a modified appearance, intended to indicate the recommended choice to the user.
TRUE / FALSE
button
dpi
string
Sets the screen resolution for the 4D Write Pro area contents.
0, 72, 96
4D Write Pro
hideFocusRing
boolean
During execution, a field or any enterable object is outlined by a selection rectangle when it has the focus. You can hide this rectangle with this option.
TRUE / FALSE
input, Write Pro, subform, list, list box
hideSystemHighlight
boolean
This property is added for selection type list boxes only. It is used to specify hiding highlighted records in the list box.
TRUE / FALSE
list box
labelsPlacement
string
Specifies the location of an object's displayed text.
"none", "top", "bottom", "left", "right"
tab, progress indicators, ruler
layoutMode
string
Sets the mode for displaying the 4D Write Pro document in the form area.
"embedded, "draft", "page"
Write Pro
scrollbarHorizontal
string
A tool allowing the user to move the viewing area to the left or right.
"visible", "hidden", "automatic"
input, Write Pro, subform, list, listbox
scrollbarVertical
string
A tool allowing the user to move the viewing area up and down.
"visible", "hidden", "automatic"
input, Write Pro, subform, list, listbox
showBackground
boolean
Displays/hides both background images and background color (displayed by default).
TRUE / FALSE
Write Pro
showHeaders
boolean
Enables or disactivates the visibility of the document or list box headers.
TRUE / FALSE
Write Pro, list box
showHiddenChars
boolean
Displays/hides invisible characters (hidden by default).
TRUE / FALSE
Write Pro
showHorizontalRuler
boolean
Displays/hides the horizontal ruler (displayed by default).
TRUE / FALSE
Write Pro
showVerticalRuler
boolean
Displays/hides the vertical ruler (displayed by default).
TRUE / FALSE
Write Pro
showHTMLWysiwyg
boolean
Enables/disables the HTML WYSIWYG view, in which any 4D Write Pro advanced attributes which are not compliant with all browsers are removed (disabled by default).
TRUE / FALSE
Write Pro
showFooters
boolean
Enables or disactivates the visibility of the document or list box footers.
TRUE / FALSE
Write Pro, list box
showPageFrames
boolean
Displays/hides the page frame when Page view mode is set to "Page". Default is hidden.
TRUE / FALSE
Write Pro
showReferences
boolean
Displays all inserted 4D expressions in the document as references.
TRUE / FALSE
Write Pro
userInterface
string
Displays/hides 4D View Pro user interface.
"ribbon", "toolbar", "none" (default value)
View Pro
withFormulaBar
boolean
Displays/hides 4D View Pro formula bar. For use with the Toolbar interface only.
TRUE / FALSE (default value)
View Pro
zoom
string
Sets the zoom percentage for displaying 4D Write Pro area contents. Default is 100%.
Enables cycling through the contents of the picture button at the specified speed (in ticks).
minimum: 0
pictureButton
loopBackToFirstFrame
boolean
Pictures are displayed in a continuous loop.
TRUE / FALSE
pictureButton
switchBackWhenReleased
boolean
Displays the first picture all the time except when the user clicks the button. Displays the second picture until the mouse button is released.
TRUE / FALSE
pictureButton
switchContinuously
boolean
Allows the user to hold down the mouse button to display the pictures continuously (i.e., as an animation).
TRUE / FALSE
pictureButton
switchWhenRollover
boolean
Modifies the contents of the picture button when the mouse cursor passes over it. The initial picture is displayed when the cursor leaves the button’s area.
TRUE / FALSE
pictureButton
useLastFrameAsDisabled
boolean
Enables setting the last thumbnail as the one to display when the button is disabled.
Allows modifying the relative location of the title in relation to the associated object. No effect if the object contains only a title (no associated picture) or a picture (no title).
"left", "right", "top", "bottom", "center"
button, checkbox, radio
threeState
boolean
Allows a check box object to accept a third state.
Minimum interval accepted between values during use. For numeric steppers, this property represents seconds when the object is associated with a time type value and days when it is associated with a date type value.
varies
progress indicators, ruler, stepper
showGraduations
boolean
Displays/Hides the graduations next to the labels.
Used to specify the set to be used to manage highlighted records in the list box (when the Arrays data source is selected, a Boolean array with the same name as the list box is used).
varies
list box
lockedColumnCount
integer
Number of columns that must stay permanently displayed in the left part of the list box, even when the user scrolls through the columns horizontally.
minimum: 0
list box
staticColumnCount
integer
Number of columns that cannot be moved during execution.