Object Summary
The object summary is a layout element (group) that can be used to display summarized data about an object on a detail layout of this object.
Adding an object summary to a detail layout
An object summary group can be added to any given detail layout by using Add.ObjectSummary
, as shown in the example below. The object summary must be added directly to the detail layout, i.e. not to any children of the layout. Multiple object summaries can be added, although this is not recommended because it blocks vertical space.
using (var detail = Builder.Add.Layout(Elements.Person, "Detail", LayoutType.Detail)
{
using (var objectSummary = detail.Add.ObjectSummary())
{
// Add rows/items here
}
}
Adding items to the object summary
Any type of IMetaProperty
can be added as item in the object summary. Items can currently only be added inside horizontal rows. Use the Add.Row
on the object summary group to add rows. To create more complex layouts, rows can also be nested inside rows.
Items can be added to a row using Add.Link
(adds a text or text/icon field) or Add.IconLink
(adds an icon only field). Both these methods have several overloads allowing to specify an icon, its color and its background color as strings or expressions.
To separate groups, use Add.Separator
inside a row. This adds a vertical separator line between fields.
using (var objectSummary = detail.Add.ObjectSummary())
{
using (var objectSummary = detail.Add.ObjectSummary())
{
using (var row = objectSummary.Add.Row())
{
row.Add.Link(metadata.Person.Status, "material-icons-outlined check", "green", "white");
row.Add.IconLink(metadata.Person.Company, "material-icons-outlined apartment");
row.Add.Separator();
row.Add.Link(metadata.Person.Office);
row.Add.IconLink(metadata.Person.AbsoluteLink, "material-icons-outlined public", "yellow");
}
}
}
Note that all properties added to an object summary group will always be rendered as "PresentationField", i.e. as read-only representation of the field value. Editing data inside the object summary is not supported.
Using object summary items as links
Object summary items can be used to link to pages within or outside of the application. The following navigation link aspects can added to a summary item to do so:
Absolute Link: Use
SetAbsoluteNavigationLink
to add a link to an external url. Arguments:Url: The absolute url to open
OpenInNewTab (optional): Whether to open the target in a new tab. Default: true.
Class Link: Use
SetClassNavigationLink
to add a link to a list of objects of a given MetaClass. Arguments:MetaClass: The name of the MetaClass
Layout (optional): The name (or name expression) of the list layout to show
OpenInNewTab (optional): Whether to open the target in a new tab. Default: false.
Object Link: Use
SetObjectNavigationLink
to add a link to a specific object of a specific MetaClass. Arguments:MetaClass: The name of the MetaClass
PrimaryKey: The primary key (or key expression) of the object
Layout (optional): The name (or name expression) of the list layout to show
TabIndex (optional): The index of the tab to open, if the specified/default layout contains multiple tabs.
OpenInNewTab (optional): Whether to open the target in a new tab. Default: false.
Note that only one navigation link aspect can be added per summary item.
using (var objectSummary = detail.Add.ObjectSummary())
{
using (var row = objectSummary.Add.Row())
{
row.Add.Link(PropertyA)
.SetAbsoluteNavigationLink("<https://www.encodo.com");>
row.Add.Link(PropertyB)
.SetClassNavigationLink("Address", "ListLayoutA", true);
row.Add.Link(PropertyC)
.SetObjectNavigationLink("Address", "28793", "DetailLayoutX", 2, true);
}
}