cancel
Showing results for 
Search instead for 
Did you mean: 

Extending Fiori Smart Template App

Former Member
0 Kudos

Hi,

I've created an app using CDS annotations and a fiori smart template. I'm trying to extend this app. In particular I need to extend the functionality around the Object Page (sap.suite.ui.generic.template.ObjectPage) Edit button (to do some additional checks before update).

I can't seem to find where I can do this. I've found the onEdit functionality in ControllerImplementation.js

and I have noticed that this has an ExtensionAPI

But I don't know where to start in coding my extension (in particular what to add into my manifest.json file to implement.

I've found the attached help but need a bit more detail!

API for developers of smart template extensions

Any assistance would be greatly appreciated, thanks

Andrew

Accepted Solutions (0)

Answers (1)

Answers (1)

m_aguilera_zorzo
Explorer

Hi,
I hope this still helps.

If you want to create an extension, in the manifest.json, you should add your views and your controllers in the following way.

ReplaceFacet can be AfterFacet or BeforeFacet too. Those are the tabs in the object page.

In your controller, you have to register the extension API.

Util.getObjectAPI(this.extensionapi) does return this.ObjectAPI.

Then we attach the events we want to handle. (Cancel, save, pageDataLoaded, registerUnsavedDataCheckFunction).

In your case, if you want to know when the EDIT button is clicked, then you should register for a change in the global model variable "/editable".
In the onInit method, we do the following:


Hope this helps!

DouglasCezar
Contributor
0 Kudos

Hello @m.aguilera.zorzo

Can you please tell how to get access to Util.getObjectAPI() ? It is not working for me.

Thank you a lot!

Douglas

m_aguilera_zorzo
Explorer
0 Kudos

Dear @Douglas Cezar Kuchler

Util.getObjectAPI just returns the standard object extensionAPI.
You must extend ObjectPageExtension to have this functionality.

Hope this helps!