Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
335 views
in Technique[技术] by (71.8m points)

Master menu is not visible on mobile devices but is visible on InternetExplorer

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...