Skip to content
Open
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
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,36 @@ annotate srv.criticalAction with @(
);
```

##### Confirmation Popup

<i>since UI5 Version: 1.100.0</i>
<i>Search term:</i> [`#ConfirmationPopup`](../../search?q=ConfirmationPopup)

SAP Fiori elements will display confirmation popups for application specific actions and the standard actions Save, Activate, Create when a transition message with the error code 412 is returned.
For that SAP Fiori elements sends the first action call with the header parameter 'Prefer:handling=strict'. The backend can react to that by sending the 412 error back and a confirmation popup will be shown with the message and two buttons: "Confirm" and "Cancel".
After pressing confirm, SAP Fiori elements will call the action again, however this time without the parameter 'Prefer:handling=strict' and the backend can execute the action.

An example implementation of the backend handler for CAP Node.js can be seen below.

```ts
this.on("confirmAction", async (req: any) => {
if (req.headers?.prefer?.includes("handling=strict")) {
req.res.setHeader("Preference-Applied", "handling=strict");
return req.reject(412, {
code: "STRICT",
details: [
{
message: "Please confirm the action!",
},
],
});
}
return req.notify(`Action executed`);
});
```

More information are available in the [SAP UI5 Documentation](https://sapui5.hana.ondemand.com/#/topic/9a536627a6a94de084b0605eb164d2c8.html).

##### Message Toasts

<i>Search term:</i> `#MessageToast`
Expand Down
1 change: 1 addition & 0 deletions _i18n/i18n.properties
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,4 @@ DELIVERY=Delivery
DELIVERIES=Deliveries
DeliveryItems=Delivery items
DeliveryItem=Delivery item
confirmAction=Action with confirmation popup
2 changes: 1 addition & 1 deletion app/deliveries/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@sap/ux-ui5-tooling": "^1.14.3",
"@sapui5/types": "~1.140.0",
"@ui5/cli": "^4.0.0",
"typescript": "^5.1.6",
"typescript": "^6",
"ui5-task-zipper": "^3.4.1",
"ui5-tooling-transpile": "^3.7.5"
},
Expand Down
6 changes: 6 additions & 0 deletions app/listreport-objectpage/layouts_RootEntities.cds
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ annotate srv.RootEntities with @(
//The Action is in the footer of the object page
Criticality: criticality_code, //Only 0,1,3 supported
},
{
//Search-Term: #ConfirmationPopup
$Type : 'UI.DataFieldForAction',
Action: 'LROPODataService.EntityContainer/confirmAction',
Label : '{i18n>confirmAction}',
},
],


Expand Down
2 changes: 1 addition & 1 deletion app/listreport-objectpage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@sap/ux-ui5-tooling": "^1.14.3",
"@sapui5/types": "~1.140.0",
"@ui5/cli": "^4.0.0",
"typescript": "^5.1.6",
"typescript": "^6",
"ui5-task-zipper": "^3.4.1",
"ui5-tooling-transpile": "^3.7.5"
},
Expand Down
2 changes: 1 addition & 1 deletion app/worklist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@sap/ux-ui5-tooling": "^1.14.3",
"@sapui5/types": "~1.140.0",
"@ui5/cli": "^4.0.0",
"typescript": "^5.1.6",
"typescript": "^6",
"ui5-task-zipper": "^3.4.1",
"ui5-tooling-transpile": "^3.7.5"
},
Expand Down
Loading
Loading