Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controller example deprecated? #19

Open
tobkle opened this issue Jul 22, 2022 · 0 comments
Open

Controller example deprecated? #19

tobkle opened this issue Jul 22, 2022 · 0 comments

Comments

@tobkle
Copy link

tobkle commented Jul 22, 2022

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant