fiori-elements-opensap icon indicating copy to clipboard operation
fiori-elements-opensap copied to clipboard

Controller example deprecated?

Open tobkle opened this issue 2 years ago • 0 comments

The example in the OpenSAP Training does not or no longer work: This part is not working:

onShareClick: function (oEvent) {
    var oExtensionApi = this.base.templateBaseExtension.getExtensionAPI();
...

this.base is not accessible, or do I miss a step before?

I suppose you need this instead?

sap.ui.define([
	'sap/ui/core/mvc/ControllerExtension',
        'sap/suite/ui/generic/template/extensionAPI/extensionAPI',     // ADD THIS
	],
	function (
		ControllerExtension,
                ExtensionAPI   // ADD THIS
	) {
		"use strict";
		return ControllerExtension.extend("customer.my-app-id.enhanced.myController", {

			onShareClick: (oEvent) => {
                               const oExtensionApi = ExtensionAPI.getExtensionAPI()    // CHANGE THIS

tobkle avatar Jul 22 '22 06:07 tobkle