Skip to main content
Version: 7.0

Form extension

The form extension technique allows the developer to extend the structure of a form created in another module — adding further objects, the properties and actions shown for them, filters, and orders, as well as refining elements the form already declares. A module can likewise customize the form's design.

Form extension allows you to extract a specific functionality into a separate module, which when loaded will cause new components to be "embedded" into existing forms. The disadvantage of this approach is that this module must know the precise structure and design of the form which it depends on, and when these are modified the module may become inoperative.

A contributed object, property, or action can be given a chosen position relative to the ones already on the form — before or after a specific one, or at the start or end. For objects this position sets their place in the form's order of object groups; that order in turn governs a property's display group and the object group a filter applies to.

Language

In order to extend the structure of an existing form instead of creating a new one, the EXTEND FORM statement must be used.

Examples

CLASS ItemGroup;
name = DATA ISTRING[100] (ItemGroup);

itemGroup = DATA ItemGroup (Item);

EXTEND FORM items
PROPERTIES(i) NEWSESSION DELETE // adding a delete button to the form

OBJECTS g = ItemGroup BEFORE i // adding a product group object to the form before the product
PROPERTIES(g) READONLY name
// if the object was added after the object with products, then filtering
// would go by the group of products, and not by products
FILTERS itemGroup(i) == g
;