Skip to Content
0
Jan 23, 2015 at 04:36 PM

Session expiration and Model in SAPUI5

945 Views

Hi all,

I'm using SAPUI5 in the context of HCP Java development.

I need to check user session expiration and this can be done with some nice code:

jQuery(document).ajaxComplete(function(e, jqXHR){
  if(jqXHR.getResponseHeader("com.sap.cloud.security.login")){
  alert("Session is expired, page shall be reloaded.");
  window.location.reload();
  }
}

I can place this code in the jQuery.ajax "complete" event handler

But where should I place it when the model is loaded with:

JSONModel.loadData() > JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.model.json.JSONModel

I can see the event: requestCompleted

but I can't find an event parameter to access the HTTP response like jQuery's jqXHR

How can this be done?

Thanks, Vincenzo