问题
I'm working on a SAPUI5 App showing some data in a MasterDetailView using the sap.m.splitapp. My Problem is quit equal to the question Master menu is not visible on mobile devices but is visible on tablet.
In my case, I have the situation, that I'm going to create a MasterPage with a MasterController depending on requested data. Depending on these data I create dynamically the DetailPages in a function of the MasterController.
for(var i=0;i<adata.inhaltList.length;i++){var DetailPage = new sap.m.Page({
title: masterString,
showNavButton: true,
navButtonPress:function () {
var oSplitApp = this.getView().getParent().getParent();
var oMaster = oSplitApp.getMasterPages()[0];
oSplitApp.toMaster(oMaster, "flip");
}
}); };
On my test device, everything is working fine except the fact, that I have no possibility to show the MasterPage, even no Button is shown.
I have tried the solution of th linked question, but I get the error: "Object Element sap.m.Page#__page0 has no method 'getView'". So it didn't work. Even a Do-it-yourselve solution, adding a button in a custom-Header:
contentLeft: [new sap.m.Button({
icon: "sap-icon://paging",
press: function() {
var splitApp = sap.ui.getCore().byId("ContentApp");
if (splitApp.isMasterShown()) {
console.log("Master weg");
splitApp.hideMaster();
} else {
console.log("Master kommt");
splitApp.showMaster();
var oSplitApp = this.getView().getParent().getParent();
var oMaster = oSplitApp.getMasterPages()[0];
oSplitApp.toMaster(oMaster, "flip");
};
}
})]
and trying to show the Master manually didn't work.
The SAPUI5 function: oSplitApp.showMaster(); works fine in the explorer but not on the device! Does anybody knows why? And has probably a solution?
回答1:
I've found it out:
Even with the postet "tricks", the SplittApp class is not available for the Phone category. So, to see the masterView, I have created a PopUpMenu, which looks like the MasterPage.
Everything fine know and thank you for downgrading my question, because nobody knows that exactly.
来源:https://stackoverflow.com/questions/40718078/master-menu-is-not-visible-on-mobile-devices-but-is-visible-on-internetexplorer