Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2067

Re: 'window' object within Personas events

$
0
0

Hello Krishna,

 

that's an intiguing problem.

 

Your onhashchange handler is not called because you have to attach it to the outmost window.

From a personas script perspective this is the "parent"-window. So this worked for me when executed as a personas script, e.g. as onLoad or onClick.

 

parent.onhashchange= function(ev){

  var sTransactionName = ev.newURL.substring(ev.newURL.indexOf("#")+1);

  session.startTransaction(sTransactionName);

  sap.personas.scripting.executeScriptInternal({src: ''}); // this is needed to refresh the screen.

};

 

 

The other option avoiding having to register a callback is to call the following from your UI5 page:

<personaswindow>.frame[0].sap.personas.scripting.executeScriptInternal({src: 'session.startTransaction("'+sTransactionName+'");'});

The potential problems with this approach are:

1) Cross scripting issues may occur if your UI5 page and personas are not in the same domain.

2) You have to access the right frame, the one that has the method sap.personas.scripting.executeScriptInternal(), which should be frame[0] from the personas main window.

 

Best Regards,

Clemens


Viewing all articles
Browse latest Browse all 2067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>