cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori element - Object list - disable navigation

chris_SAP
Participant

I'm creating a list report with selection using Fiori element.
I have created annotation extension to my CDS.
I would like to disable the option to navigate to object page.

How can I do that with annotation in CDS (or in VS code annotation)

Thanks for your support.

capture-decran-2022-04-15-175328.png

Accepted Solutions (1)

Accepted Solutions (1)

mpah
Explorer

See documentation at https://sapui5.hana.ondemand.com/sdk/#/topic/2c65f07f44094012a511d6bd83f50f2d.html

You can control whether it is possible to navigate to a detail page. 
It simply depends on whether you keep the predefined definition of a subpage:

In the manifest defenition you can see

// Navigation to detail page: eliminate this block if no navigation is needed

chris_SAP
Participant
0 Kudos

Good, the exact solution is to delete the model of object page in the manifest.

Answers (1)

Answers (1)

Edrilan_Berisha
Product and Topic Expert
Product and Topic Expert
0 Kudos

I am not sure if this is possible via annotations. This seems more like a possible frontend breakout to me.

This should be the solution for you:

sap.ui.controller("your.application.name.ext.controller.ListReportExt", {
  onBeforeRebindTableExtension: function (oEvent) {
    var oBindingParams = oEvent.getParameter("bindingParams");
    oBindingParams.events = {
      "dataReceived": function () {
        this.oSmartTable = sap.ui.getCore().byId("your.application.name::sap.suite.ui.generic.template.ListReport.view.ListReport::C_CDS_VIEW_NAME--listReport");
        this.oTableRows = this.oSmartTable.getTable().getItems();
        this.oTableRows.forEach(function (oRow) {
            oRow.setType(sap.m.ListType.Inactive);
        });
      },
    };
  },
});