on 09-29-2016 8:52 AM
HI Experts,
I am using routing in my SAPUI5 application. I have a requirement where when the user presses refresh(F5) button, the Home View should appear.
Can some one help?
Thanks in advance.
Ranjit
Hello Ranjit,
here is a workaround i have tried in SAPUI5 version 1.28.3 and 1.38.3, you can write below line inside init function of component file after initialize the router.(we can find more appropriate trigger point also)
this.getRouter().initialize();
$(document.body).on("keydown", this, jQuery.proxy(this._onKeyPress, this));
and function is:
_onKeyPress: function(oEvent) {
oEvent = oEvent || window.event;
if (oEvent.keyCode == 116) {
this.getRouter().navTo("worklist", {}, true);
}
}
hope this will help you.
Regards,
Akhilesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
window.onbeforeunload = function (e) {
e = e || window.event;
if (window.event.keyCode == 116) {
alert("f5 pressed");
}
};
Regards Yalcin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.