on 05-04-2015 9:58 AM
Hi,
iam wriing a function for handling device back button(in android) press in my app.controller.js .How to get current viewname when clicking device back button.
code samples will be helpful.
my app.controller.js looks like below
sap.ui.controller("com.opensap.App", {
onInit : function() {
document.addEventListener("deviceready", onDeviceReady, false);
},
onBeforeShow : function(evt) {
},
navButtonTap : function(evt) {
}
});
function onBackKeyDown(){
//alert("hai");
//sap.ui.getCore().byId("SalesDetail").app.backToPage("ProductList");
//sap.ui.getCore().byId("ProductList").app.backToPage("Dashboard");
//sap.ui.getCore().byId("SupplierDetail").app.backToPage("Dashboard");
}
function onDeviceReady(){
document.addEventListener("backbutton", onBackKeyDown, false);
}
I somehow managed to find the solution
function onBackKeyDown(){
var app = sap.ui.getCore().byId("LoginDetail").app;
app.back();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
9 | |
8 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.