cancel
Showing results for 
Search instead for 
Did you mean: 

Use formatter in fiori elements custom section of object page

IrisBirnbaum
Discoverer
0 Kudos

Hello,

I'm working on a RAP Appliction with odata v4 with fiori elements front end.

I have a simple List Page -> Object Page setup. In the Object Page there are 2 custom sections. In those custom sections I would like to use a formatter, but I'm not sure how to.

I couldn't find it discribed in the feature showcase (https://github.com/SAP-samples/fiori-elements-feature-showcase#custom-actions-object-page), so I tried to add a controller. The live cycle functions in the controller are beeing called (yeah \o/) but I can not call other functions outside of it as it is explained here: https://ui5.sap.com/test-resources/sap/fe/core/fpmExplorer/index.html#/controllerExtensions/guidance....

Is this possible at all? Am I missing something?

structure:

manifest.json

Controller Extension:

Controller

Call to function using require core -> not working

with error: failed to load 'ppt/ext/controller/ShiftPlanner.js' from ../ext/controller/ShiftPlanner.js: script load error

Call to function using extension syntax -> also not working

with error: formatter function .extension.ppt.ext.controller.ShiftPlanner.iconFormatter not found!

Thanks in advance,

Iris

View Entire Topic
AndreasKunz
Advisor
Advisor

Hi Iris,

Can you check what JavaScript code is generated from your TypeScript code? (always a good idea when something does not work as expected)

In particular the name of your controller extension would be interesting: as you said "@namespace ppt.ext.controller.ShiftPlanner" in the JSDoc (as opposed to @name), I assume that the controller accidentally is named "ppt.ext.controller.ShiftPlanner.ShiftPlanner". Make it @name or use the pure package name without class name in this case. Maybe this already makes it work. If not, look further how the JS looks, maybe that helps.

IrisBirnbaum
Discoverer
0 Kudos

Hi Andreas,

Thank you for taking the time to look at this.

Indead you are correct. The controller is named "ppt.ext.controller.ShiftPlanner.ShiftPlanner"

I'll have a look at the js files in the future, when problems like this occure 🙂