cancel
Showing results for 
Search instead for 
Did you mean: 

Override back button on FLP

Violina
Discoverer
0 Kudos
206

Hello,

I'm trying to override the back button behavior on Sap Build Workzone. My application is Fiori Elements with Fiori Freestyle with odata v4. I want to raise an exception when a user is in the Object Page in edit mode and clicks on the back button. I tried the suggestions here https://community.sap.com/t5/technology-q-a/flp-nav-back-button-issue/qaq-p/12142325/comment-id/4538.... But didn't work for me. I tried using this part:

this.getOwnerComponent().getService("ShellUIService").then(function(oShellService) {
    oShellService.setBackNavigation(function() {
        //either do nothing to disable it, or add your own nav back logic for having the navigation
    });
});

In the onAterRendering method of the Object Page controller, but it doesn't enter the setBackNavigation function. Can someone help with this issue.

 

Thanks,

Violina

View Entire Topic
RaminS
Active Participant
0 Kudos

My attempts to capture the browser back event have never been completely successful in the past. 

If you're using the standard draft-handling mechanism, then the user entries should be saved as draft and they can continue later when they enter the object page again. Not sure if that behaviour is acceptable for your use case.

Sankara1
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hello Violina, Thanks for reaching out to us, I believe that sap.ushell.Container is designed to implement dirty state flags specifically for this purpose. You can either attach a dirtyStateProvider https://sapui5.hana.ondemand.com/sdk/#/api/sap.ushell.Container%23methods/registerDirtyStateProvider (asynchronous) or directly set the dirtyState flag to true ( https://sapui5.hana.ondemand.com/sdk/#/api/sap.ushell.Container%23methods/setDirtyFlag) whenever the user modifies or enters data. I hope this information is helpful. Please Let us know if you have further clarification