Form#
A form (FormComponent
) is special type of SegmentComponent
that is used for displaying and editing the metadata of an M-Files object as fields, depending on whether you have enabled Controls
for your Portal or not.
It contains a set of FormComponent
s
FormComponents#
All FieldComponent
s can contain Field
s.
AccordionComponent
: Represents an accordion UI component. Accordions are commonly used in web and mobile interfaces to display information in a collapsible manner. Here is an example of how the accordion component can be used.
Notice that a PortalRule can be used to determine whether it should be expanded or collapsed by default.
Fields
: An unorganized set of fields. Fields added to this component are not arranged.Field Column
: A single column of fields. Fields added to this column are arranged vertically.Field Row
: A row of fields, Fields added to this row are arranged horizontally.
Fields#
A Field represents an M-Files metadata property for the object associated with the M-Files Portal.
Fields can be configured with six different options:
Property: The property that the field will display / edit.
TextAreaHeight: If the underlying property is a multi-line text property, this option can determine how tall the input text field should be, regardless of the contents of the field. This height is given as lines of text, e.g. if you set this to ‘4’ the input text field will always accommodate at least four rows of text.
Required when: A predicate defined from PortalRules used to determine when the field should be required when editing the form. If you set this to e.g. ‘true’ the field is always required, meaning that it needs to hold some value before the changes to the metadata can be saved.
Additional when: A predicate defined from PortalRules used to determine whether the field should be displayed as an empty, editable field even if it’s not part of the object’s metadata card.
Show when: A predicate defined from PortalRules used to determine when the field should be displayed in the Portal.
Read-only: A predicate defined from PortalRules used to determine when the field should be displayed read-only, meaning that it cannot be edited through the portal.
Special Types#
Beyond the default M-Files data types, Portals also support some ‘special types’, which are just a different way of presenting possible values to the users of a Portal.
Checkbox#
The checkbox type is used like the radio buttons type, to limit selections from a property, but instead of allowing only one value to be selected, it allows multiple values to be selected. The configuration is the same as for radio buttons.
Rating#
The rating type is used to make a prettier and more intuitive interface for a regular ‘number (integer)’ field in M-Files.
The displayed Icon, Color and maximum amount can be configured.