cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best possible way to add a custom dialog to Fiori Elements - Object Page footer?

BrijeshGandhi
Product and Topic Expert
Product and Topic Expert
0 Kudos
2,988

Hello ,

I need to add custom action in footer for Fiori Elements - Object Page.

With the help of Page map in BAS , I am able to generate ListReportExtention.js file as following , however it does not bind to the controller and not allowing to close the dialog.

Please help with the best possible way to carry out custom action in footer for fiori elements - Object Page.

Accepted Solutions (1)

Accepted Solutions (1)

BrijeshGandhi
Product and Topic Expert
Product and Topic Expert
0 Kudos

I found the way to achieve with the controller code within the ListReportExt.js file.

Please find the sample code : https://github.com/SAP-samples/cloud-cap-samples-java/blob/main/app/admin/webapp/extension/Upload.js

Answers (2)

Answers (2)

stefan_schreck
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Brijesh!
Are you using OData V2, or OData V4?
There is also some confusion about Object page (title) vs. list report (ListReportExtention) - where do you want to see the extension?
For OData V4 you can find various examples at the FPM Explorer - maybe you can compare your coding with the examples that you can find here.
But it would also be interesting for us to know why the code as generated from the Page Map did not work as expected. Could you please open a ticket in Service Now for us, on component CA-UX-IDE?
Thanks & regards,
Stefan Schreck
(Fiori Tools)

stefan_schreck
Product and Topic Expert
Product and Topic Expert
0 Kudos

OK, I tried by myself: at the moment, the Page Map only supports adding custom actions at Object Pages of OData V4 apps.
The generated default code looks like in the following example. When I tested the app preview, the message toast appeared, but then hides automatically after a few seconds. This is the exact behavior as described at https://ui5.sap.com/#/api/sap.m.MessageToast.
If you face some problem with the message toast, you should rather address to the UI5 component CA-UI5-CTR.

sap.ui.define([
    "sap/m/MessageToast"
], function(MessageToast) {
'use strict';
return {
press: function(oEvent) {
MessageToast.show("Custom handler invoked.");
}
};
});
BrijeshGandhi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thank , stefan.schreck for checking.

Generated code works perfactly fine.

Requirement is to show Dialog Box on press of the custom action , which works fine .

However I am unable to close the dialog as onPress event handler is not accessible.

stefan_schreck
Product and Topic Expert
Product and Topic Expert
0 Kudos

OK, if it is a binding problem of your controller, maybe the examples from https://ui5.sap.com/#/entity/sap.m.Dialog/sample/sap.m.sample.DialogMessage/code can help? Here, the controller is explicitly specified in a mvc view

junwu
SAP Champion
SAP Champion
0 Kudos

make sure this.byId find the dialog

BrijeshGandhi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thank you for the answer , however handler function onCloseDialog is not accessible by the Dialog / Fragment