New Detail
Level: Beginner
Keywords: entity, detail, info detail, edit form, LIDS form, propertyGroup
The result: defined Info detail and Edit form for chosen entity
How to define Info detail and Edit form for entity?β
In SAMO there are three basic types of details (or forms).
The first type, called Information detail, serves for visualizing read only data about the entity. It also enables to enrich the detail with other web modules showing information about related features, attachments, comments and other things.
The second type, called Edit form (or Edit detail), enables user to edit and update values of predefined attributes.
Third type, called Action form is used for user input during business actions.
Following chapters will describe how to configure the most basic details and forms.
Add detail to folder structureβ
Currently, there are two possibilities of assigning detail to entity. First option is to include it directly in the entity metadata, as an object of detail, edit or action property.
{
"extends": "ft_defBoDefect",
"title": "{tr:defects.defectElectro}",
"defaultDetailPropertyGroup": "fmd_defDefectElectro_detail",
"detail": {
"default": {
"sections": [
{
"title": "{tr:info}",
"icon": "samo-default-icons:info",
"module": {
"type": "component:entity-modules/detail/samo-entity-properties-detail",
"title": "{tr:info}"
}
}
]
}
}
}
The second option is to create separate file with detail content and link it with the entity metadata. Detail content should be stored under the details folder:
dynamic-app
β
ββββsamo-demo\configuration\metadata
β
ββββentities
β
ββββfeatures
β
ββββdefects
ββββdetails
β ββββft_defBoDefect-detail-default.json
β ββββft_defBoDefect-editDetail-default.json
β ββββft_defBoDefect-editDetail-insert.json
β ββββft_defBoDefect-actionDetail-default.json
ββββft_defBoDefect.json
And linked with the entity metadata:
{
"extends": "ft_defBoDefect",
"title": "{tr:defects.defectElectro}",
"defaultDetailPropertyGroup": "fmd_defDefectElectro_detail",
"detail" : {
"default": {
"extends": "ft_defBoDefect-detail-default"
}
}
"edit" : {
"default": {
"extends": "ft_defBoDefect-editDetail-default"
},
"insert": {
"extends": "ft_defBoDefect-editDetail-insert"
}
},
"action" : {
"default": {
"extends": "ft_defBoDefect-actionDetail-default"
}
}
}
Detail contextβ
Notice, that in the previous example there are two detail references for Edit detail. These two different references correspond to two diferent detail contexts. There is a possibility to define multiple details for the same entity, which are shown in different situations (different contexts). Each entity should have detail with default context, details in additional contexts are optional. Which detail context should be used in a specific situation is defined in other DA components (e.g. SAMO Browse, related entity sections, planning board), which load the context content from the detail configuration.
In our case, we have one detail which is used for creating Defects (the one referenced in insert Edit detail context) and a different one for editing Defects (the one referenced in default Edit detail context).
Add detail (form) contentβ
All three types of details have similar content structure, which is described in the Dynamic-App Module Catalog in more detail.
It begins with the context in which the detail should be loaded. All features should have defined the default context. For example if we want to load different detail of the defect entity, if we look at it from the asset, we need to define additional context (e.g. defect).
After the detail context, there is the array of detail sections. Each section consists of a web module providing the detail content. An overview of suitable web modules used is shown in Detail Modules and Form Modules.
There is also a possibility to group the content of detail (or form) using the section-group-module.
{
"header": null,
"sections" : [
{
{
"module" : {
"type": "component:dynamic-app/modules/common/section-group-module",
"title" : "Employee",
"icon" : "cbu-icons:person",
"collapsible" : true,
"sections" : [
{
//section content - web module
},
{
//other section content - web module
}
]
}
}
}
]
}