cancel
Showing results for 
Search instead for 
Did you mean: 

ControllerExtension.use(EditFlow) with typescript does not work

shf
Explorer
0 Kudos
90

Hello,

I'm using typescript in my Fiori app and like to use EditFlow extension . I have a problem in initiating the EditFlow extension . 

 

 

import ControllerExtension from "sap/ui/core/mvc/ControllerExtension";
import EditFlow from "sap/fe/core/controllerextensions/EditFlow";
import Controller from "sap/ui/core/mvc/Controller";

/**
 * @namespace paltr.core.configsystemkind
 */
export default class SetSystemKindsTitlesCustomAction extends Controller {
  private editFlow: EditFlow;
  public onInit(): void {

        this.editFlow = ControllerExtension.use(EditFlow);
    }
   ....
}

 

 

I'm not using the Babel plugin, I'm using the ui5-tooling.transpile version 3.7.2 instead as described in the Fiori documentation section "Assigning controller extension" Using Controller Extension - Documentation - Demo Kit - SAPUI5 SDK

The mention "npm update" was executed.

My issue is ControllerExtension.use(EditFlow) throws the error "

Argument of type 'typeof EditFlow' is not assignable to parameter of type 'new () => EditFlow'.
Cannot assign a 'protected' constructor type to a 'public' constructor type.".
 
How do I call the extension correctly in typescript?

Accepted Solutions (1)

Accepted Solutions (1)

MioYasutake
Active Contributor

@shf 

I have used the EditFlow with TypeScript as the example below:

https://github.com/miyasuta/rap-exel-upload-ui/blob/75b74911768266364d9f0a13e87160211b012039/webapp/...

this.base.getExtensionAPI().getEditFlow()

 

Answers (0)