cancel
Showing results for 
Search instead for 
Did you mean: 

Extending a sap.fe app, oData v4

jthuijls
Participant

Hi,

I've been trying to add a button that launches a custom dialog on a subsection of an object page.

I've gone through most of the examples as far as I could find them like the cloud samples, the bookshops, the star wars apps, and I've tried the guided development. With the V2 fiori elements, some of the extensions in the guided development use a controller extension like this:

"sap.suite.ui.generic.template.ListReport.view.ObjectPage": {
     "controllerName": "namespace.ObjectPage.Extension"
}

This does nothing in `sap.fe` because it doesn't use the generic templates. Instead, it seems to go through:

"sap.fe.templates.ObjectPage.ObjectPageController": {
    "controllerName": "namespace.ObjectPage.Extension"
}

This throws all sorts of errors, which seems correct because indeed, oController is not instantiated:

So I'm going to assume I'm not doing it right.

How do I extend a `sap.fe` controller?

Edit: images didn't come through.

View Entire Topic
jthuijls
Participant
0 Kudos

Ok, so manifest entry is correct, but the trick was to use a controller extension.

sap.ui.define(['sap/ui/core/mvc/ControllerExtension'], function(Controller) {
  'use strict';

  return Controller.extend("namespace.ObjectPage.Extension", {

  });
});

I've been made aware this might change in the future since there's still some debate on how to handle these extensions through the manifest for `sap.fe`.

Jacky_Liu
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi, jthuijls,
Jacky_Liu
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi, jthuijls, I face the same issue in https://community.sap.com/t5/technology-q-a/no-response-when-clicking-close-button-on-fragement-in-c... . It seems I need extension for controller also .