shao yan
shao yan

Reputation: 43

SAPUI5 Logout Event with Javascript

I am currently working on a SAP XS application. Using the provided API, I want to log off my user on the website. Im totally new on Javascript to please dont mind the probable ease of my question.

The API (https://sapui5.hana.ondemand.com/sdk/docs/api/symbols/sap.ui.commons.ApplicationHeader.html#event:logoff) provides the method "fireLogoff". But before that I have to add "attachLogoff" to the applicationheader in my application right?

My faulty method looks like this:

oAppHeader.attachLogoff(function logout(oEvent) {this.fireLogOff();});

Thank you a lot for helping a noob in this matter.

Upvotes: 0

Views: 3687

Answers (1)

Nikolay Nadorichev
Nikolay Nadorichev

Reputation: 901

fireLogOff calls a function assigned to logOff. So you need to write your own code for SAP HANA API that makes user to log off. Or you can just close browser tab:

oAppHeader.attachLogoff(function(){window.close();});

Upvotes: 1

Related Questions