Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Open `http://localhost:4008/$launchpad` in the Browser to get to the SAP Fiori l
- [Adding Currency or UoM Fields to a table](#adding-currency-or-uom-fields-to-a-table)
- [Customize Currency or UoM scale](#customize-currency-or-uom-scale)
- [Adding a link to a table](#adding-a-link-to-a-table)
- [Adding a navigation property only to personalization](#adding-a-navigation-property-only-to-personalization)
- [Add custom column (Extensibility)](#add-custom-column-extensibility)
- [Object Page](#object-page)
- [General Features](#general-features-object-page)
Expand Down Expand Up @@ -2132,6 +2133,49 @@ annotate srv.RootEntities with {

The annotation is documented [here](https://sap.github.io/odata-vocabularies/vocabularies/HTML5.html#LinkTarget).

#### Adding a navigation property only to personalization

<i>Search term:</i> [`#NavPropInAdaptability`](../../search?q=NavPropInAdaptability), [`DataField::association2one`](../../search?q=DataField::association2one::country_code)

Associations and compositions can be added as columns to a table by adding them to the `@UI.LineItem` annotation. If the property should only be available via the personalization settings, an additional configuration in the [manifest.json](app/listreport-objectpage/webapp/manifest.json) is necessary.

```cds
@UI.LineItem : [
{
//Search-Term: #NavPropInAdaptability
Label : 'Navigation field only available via settings',
Value : association2one.country_code,
}
]
```

Setting the `availability` property to `Adaptation`, will only bring up the property in the table settings for the user add it if necessary.

```json
"RootEntityListReport": {
...
"options": {
"settings": {
...
"controlConfiguration": {
"@com.sap.vocabularies.UI.v1.LineItem": {
...
"columns": {
"DataField::association2one::country_code": {
"availability": "Adaptation"
}
}
},
...
},
...
}
}
}
```

The ID of the column follows the pattern `DataField::<path>`, with the dots in the navigation path being replaced by two ':', e.g. `DataField::association2one::country_code`.

#### Add custom column (Extensibility)

<i>Search term:</i> [`#CustomColumn`](../../search?q=CustomColumn)
Expand Down
5 changes: 5 additions & 0 deletions app/listreport-objectpage/layouts_RootEntities.cds
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ annotate srv.RootEntities with @(
Value : fieldWithUoM,
@UI.Importance: #Low,
},
{
//Search-Term: #NavPropInAdaptability
Label : 'Navigation field only available via settings',
Value : association2one.country_code,
},
{
$Type : 'UI.DataField',
Value : fieldWithCriticality,
Expand Down
3 changes: 3 additions & 0 deletions app/listreport-objectpage/webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@
"placement": "After",
"anchor": "DataField::fieldWithCriticality"
}
},
"DataField::association2one::country_code": {
"availability": "Adaptation"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
],
"cds": {
"launchpad": {
"version": "1.141.0"
"version": "1.145.0"
},
"requires": {
"[production]": {
Expand Down