Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Implement "Navigate to List on Save" in a Fiori Elements App with OData V4

512

Hi everyone,

I'm developing an application using the SAP CAP framework as the backend and Fiori Elements as the frontend. My app is structured as a List Report with an Object Page.

For OData V2, I know there's an easy way to achieve a "navigate to list on save" behavior by setting the attribute `"navToListOnSave": true` in the `manifest.json` of the Object Page, as described in the SAPUI5 documentation

I need to replicate this behavior in OData V4: when the user presses the "Save" button on the Object Page, the app should automatically navigate back to the List Report.

Does anyone have recommendations for implementing a robust, fast, and elegant solution for this requirement in OData V4? Ideally, I'd prefer to keep modifications minimal and aligned with Fiori Elements' declarative approach.

Any guidance, code snippets, or resources would be greatly appreciated!

Thanks in advance!

UI5 Version: 1.130.0
2 REPLIES 2

Cmdd
Participant
0 Kudos
196

Anyone who can help? @nicoschoenteich ? 

 

Pratyush_Sinha
Associate
Associate
0 Kudos
52

I couldn't find anything in the documentation for oData v4. You can try this as a workaround in your controllerExtensions for the object page. 

onAfterSave: function(mParameters) {
this.base.getExtensionAPI().routing.navigateToRoute("list_view_name_here");
},