cancel
Showing results for 
Search instead for 
Did you mean: 

Add function to sap.ui.getCore() ?

Former Member
0 Kudos

Hi,

i´m trying to implement an automatic logout functionality in my sapui5 application.

I need to reset an integer every time the user is working with the ui.

Every time i call a function i also call the sap.ui.getCore() because of controller functions so i wish to extend the getCore() function to do this.

I dont want to change the standardcode so what can i do? Is there a better way to get a inactivity timeout in sapui5?

Do i have to add a timeoutrefresh every single time in all of my controlleractions?

Maybe there is a simple way to do this but i don´t know it.

Thank you for ideas and help.

With best regards from germany

Sascha Köhler

Accepted Solutions (1)

Accepted Solutions (1)

Qualiture
Active Contributor
0 Kudos

Hi Sascha,

Why not simply use the Core's attachControlEvent() method? That should be fired upon any interaction with the UI.

If you declare it in your controller's onInit() event handler, you can do the reset there:


onInit : function(oEvent) {

    sap.ui.getCore().attachControlEvent(function (oEvent) {

         // perform your reset function here

    });

}

Former Member
0 Kudos

Hi Robin,

that's greate. I juste have to filter out some eventtypes because it fires even on mouseover events. Thank you.That was exactly what i was looking for.


Answers (0)