Item forms in action
How do item forms behave?
By default, the General section of an item's details will list all attributes of the item's design, in the order they were added (or defined in a stencil). Required attributes are indicated with an asterisk * .
If an item form is available for a design, Alloy will automatically present it to a user when they create, edit or view an item of that design (depending on the item form's configuration).
If multiple item forms exist for a design, Alloy will use the most appropriate one for the situation, based on its screen tags.
If an item form doesn't appear for a user, they may lack permission to read it.
Item forms for interfaces
If an item form is created for an interface, it potentially applies to every design that implements the interface (unless its overridden by a design-specific item form). This can save you having to create multiple item forms for multiple similar designs.
However, be aware that an interface item form can only contain controls for the interface's own attributes. Therefore, while the item form can be used with designs that implement the interface, it can't contain any design-specific attributes.
For example, while an item form for the Assets interface could be used to create/edit/view an item of the Street Lights design, it has too few attributes to be useful.
Therefore, item forms are best suited to interfaces that contain many attributes common to the designs that implement them, e.g. a Playground Equipment interface implemented by Slides, Roundabouts and Swings designs.
What if the design/interface changes?
If the attributes on a design/interface are changed, any item forms based on it may be affected.
Design/interface change | Effect on item form(s) | Action to take |
---|---|---|
An attribute is added | None | Consider adding a control for the new attribute to the item form |
An attribute is removed | The missing attribute is hidden and skipped | Remove the attribute's control from the item form |
An attribute becomes required | If the item form is submitted without a value for this attribute, it will fail | Edit the attribute's control properties to make it required too |
An attribute becomes read-only | If the item form is submitted with a value for this attribute, it will fail | Edit the attribute's control properties to make it read-only too |
An attribute is renamed | None | None |
Item forms on Alloy Mobile
If an item form exists for a design/interface, it'll automatically be displayed to users when they create, edit or view a corresponding item.
Users will only see the attributes that the item form has controls for, displayed in the order defined by the item form.
If multiple item forms are available, Alloy will choose the one most relevant to the user's situation. For example, an item form tagged as Mobile will be prioritised over one tagged All platforms.
If no item forms are available, Alloy will display the standard item form as described above.
Item forms currently have these limitations on Alloy Mobile:
-
Expressions aren't yet supported and will go unprocessed if present.
-
Some control types aren't visible on Alloy Mobile. Please refer the Control types table on Attribute controls.