sap - Split app in ui5 the back button doesnot work -
i tried implement split app feature in mobile application .but after navigating detail2 page "back" navigation button put , not work when pressed . have placed code below : (revert if need more info on that) view.js file (content) :
sap.ui.jsview("split_app.first_view", { getcontrollername : function() { return "split_app.first_view"; }, createcontent : function(ocontroller) { var olist1 = new sap.m.standardlistitem({ type: sap.m.listtype.active, title: "to detail 1", tap: function(){ osplit.todetail("detail1"); } }); var olist2 = new sap.m.standardlistitem({ type: sap.m.listtype.active, title: "to detail 2", tap: function(){ osplit.todetail("detail2"); } }); var otext = new sap.m.label({ text: "first label", }); var osplit = new sap.m.splitapp("split"); var odetail1 = new sap.m.page("detail1", { title: "first details", content: [ otext ] }); var odetail2 = new sap.m.page("detail2",{ title: "second details", shownavbutton: true, navbuttonpress: function(){ osplit.tomaster("masterpage"); app.back(); }, content: [ new sap.m.label({ text: "second label" }) ] }); var omaster1 = new sap.m.page("masterpage", { title: "master page", content:[ new sap.m.list({ items : [ olist1, olist2 ] }) ] }); osplit.addmasterpage(omaster1); osplit.adddetailpage(odetail1).adddetailpage(odetail2); osplit.setmode("showhidemode"); return new sap.m.page({ title: "title", content: [ osplit ] }); }
assuming want navigate 1 step in detail area (right side) can call backdetail() function of splitapp object when clicking on button (navbuttonpress):
osplit.backdetail();
the same function works navigation in master area (left side):
osplit.backmaster();
if want navigate within app object, make sure there previous page come , pages known app object (probably in index.html file): i´ve tested code , worked me navigate within splitapp using above mentioned functions navigating in app following declaration (in index or wherever host app object):
var app = new sap.m.app(); var init = sap.ui.view({ id : "idinit", viewname : "stackovertest.init", type : sap.ui.core.mvc.viewtype.js }) var page = sap.ui.view({ id : "idsplit_app1", viewname : "stackovertest.split_app", type : sap.ui.core.mvc.viewtype.js }); app.addpage(init); app.addpage(page);
after coming init page can use
app.back();
hopefully helps you.
Comments
Post a Comment