Form

The form element is always the top element of the JSON structure.

The following properties may be used on form object:

PropertyDescriptionExample
textThe title of the form. It is displayed in the form’s top title bar. If not specified then the form will display the calling menu item’s name as title.“text”: “Sales orders”
paramsThe list of the form’s input parameters. An array with parameter names.“params”: [“order”, “customer”]
onLoadAn action that should be run when onLoad event occurs (triggered when the form has just been loaded).“onLoad”: action
metadataThe name of the default metadata (object/object.method). It will serve as a source for form fields creation.“metadata”: “salesOrders.get”
elementsThe list of child elements - form fields that will constitue the form content.“elements”: [field1, field2]
eventsAn array of event elements. The form will listen for the events listed here and run specified action when such event occurs.“events”: [event1, event2]
actionsAn array of action elements. This is the set of the form’s main actions, by default rendered as buttons.“actions”: [action1, action2]

Example of a form with the title, 2 fields and 2 actions…

{
    "text": "My form",
    "elements": [ 
        { "id": "field1", "text": "Text field", "length": 10 },
        { "id": "field2", "text": "Numeric field", "length": 10, "type": "number" } 
    ],
    "actions": [ 
        "*close",
        {
            "text": "My action",
            "form": "myform2"
        } 
    ]
}

… and the generated HTML form

'My form' example