SAPUI5 logOff() with Shell

烈酒焚心 提交于 2020-01-25 03:50:06

问题


How would I realize the logoff function in Shell control having this API example: https://sapui5.hana.ondemand.com/sdk/docs/api/symbols/sap.ui.commons.ApplicationHeader.html#event:logoff

    var oLogoff = new sap.ui.commons.ApplicationHeader();

    ... // within the Shell (function logout)
    logout : function(oEvent) {
        oLogoff.fireLogoff(); // this.fireLogoff() also not working
    },
    ...

EDIT:
oShell.fireLogout();
--> seems to be right, but this Ends up in an error "Not enough stack Memory" .. anybody any help?

I expect returning to a Login-page ... is this handled automatically?


回答1:


The logout function of the Shell control is only an event you can use to trigger your own logout function when someone clicks the logout button in the Shell header (see here).

oShell.fireLogout() ends up in a stack overflow as you´re calling your own function again and again.

The logout itself is not done for you automatically. Depending on your deployment scenario the logout implementation differs as the session management is done differently.




回答2:


Use the shells Container logout-method:

sap.ushell.Container.logout();


来源:https://stackoverflow.com/questions/30023942/sapui5-logoff-with-shell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!