We begin with some sub-macros used within macro "showReference" defined below. Displays the title of a referenced object, with a link on it to reach the consult view for this object. If we are on a back reference, the link allows to reach the correct page where the forward reference is defined. Displays icons for triggering actions on a given referenced object (edit, delete, etc). Edit the elementDelete the elementArrows for moving objects up or down
Arrow up Arrow down
Displays the "plus" icon that allows to add new object through a reference widget. Indeed, If field was declared as "addable", we must provide an icon for creating a new linked object (at least if multiplicities allow it).
This macro displays the Reference widget on a "consult" page. The definition of "atMostOneRef" above may sound strange: we shouldn't check the actual number of referenced objects. But for back references people often forget to specify multiplicities. So concretely, multiplicities (0,None) are coded as (0,1). Display a simplified widget if maximum number of referenced objects is 1. If there is no object... If there is an object...
no_ref
Display a fieldset in all other cases.
Object description

No object is present

no_ref

Show backward reference(s)
Show forward reference(s) Object title, shown here if not specified somewhere else in appyType.shownInfo.Additional fields that must be shownActions
   
A carriage return needed in some cases.
This macro displays the Reference widget on an "edit" page