This topic is currently only applicable to SAP Fiori elements for OData V2.
Use app extensions with caution and only if you cannot produce the required
behavior by other means, such as manifest settings or annotations. To correctly
integrate your app extension coding with SAP Fiori elements, use
only the extensionAPI
of SAP Fiori elements. For
more information, see Using the extensionAPI.
After you've created an app extension, its display (for example, control
placement and layout) and system behavior (for example, model and binding usage,
busy handling) lies within the application's responsibility. SAP Fiori elements
provides support only for the official extensionAPI
functions.
Don't access or manipulate controls, properties, models, or other internal
objects created by the SAP Fiori elements
framework.
The Delete dialog looks as follows:
title: always appears
text: always appears
unsavedChanges: appears except in the following cases:
If only list report items with the editing status
unsavedChanges
are selected
If only list report items with the editing status
unsavedChanges
and locked
are
selected
If only list report items with the editing status
unsavedChanges
and items that cannot be deleted
using the deletablePath
feature are selected
If only list report items with the editing status
unsavedChanges
, locked and items that cannot be
deleted using the deletablePath
feature are
selected
If only list report items selected with the editing status
unsavedChanges
are also items that cannot be
deleted using the deletablePath
feature
undeletableText: appears only if one or more selected
items cannot be deleted using the deletablePath
feature and
the application has explicitly added undeletableText
as
part of extension.
For information about how to adapt texts on the object page, see Adapting Texts in the Delete Dialog Box (Object Page Header) and Adapting Texts in the Delete Dialog Box (Object Page with Nested Smart Table).
"extends": { "extensions": { ... "sap.ui.controllerExtensions": { ... "sap.suite.ui.generic.template.ListReport.view.ListReport": { ... "controllerName": "MY_APP.ext.controller.ListReportExtension", ... } } ...
'beforeDeleteExtension'
in the
controller extension file of the list report. You have several options to
determine the delete dialog box:
The easy way
beforeDeleteExtension: function(oBeforeDeleteProperties) { var oMessageText = { title: "My title"; text: "My text", unsavedChanges: "My unsaved changes", undeletableText: "My undeletable text" }; return oMessageText; }
Using promises
beforeDeleteExtension: function(oBeforeDeleteProperties) { var oMessageText = { title: "My title"; text: "My text", unsavedChanges: "My unsaved changes", undeletableText: "My undeletable text" }; return Promise.resolve(oMessageText); }
Using the extensionAPI.SecuredExecution
(see also Using the SecuredExecution Method)
beforeDeleteExtension: function(oBeforeDeleteProperties) { var oMessageText = { title: "My title"; text: "My text", unsavedChanges: "My unsaved changes", undeletableText: "My undeletable text" }; return this.extensionAPI.securedExecution(function() { return new Promise(function(resolve) { ... resolve(oMessageText); ... }); }); }
The property oBeforeDeleteProperties
contains information about the
selected items for deletion of the list report.