Step one: Construct apps in index.html, pages, shell
Step two: In the shell controller JS code in the OnInit method Addcontent (APP)
First Step code:
Sap.ui.localResources ("mobile");
var app = new Sap.m.app ({initialpage: "Idpage2"});
var Page1 = Sap.ui.view ({id: "Idpage1", ViewName: "Mobile.page1", Type:sap.ui.core.mvc.ViewType.XML});
var Page2 = Sap.ui.view ({id: "Idpage2", ViewName: "Mobile.page2", Type:sap.ui.core.mvc.ViewType.XML});
App.addpage (Page1);
App.addpage (Page2);
var shell = Sap.ui.view ({id: "Idshell", ViewName: "Mobile. Shellview ", Type:sap.ui.core.mvc.ViewType.XML});
Shell.placeat ("content");
The second step of the code:
Oninit:function () {
this.getview (). Byid ("Myshell"). Addcontent (app);
},
ShellView.view.xml Code:
Here is the code chip <mvc:view controllername= "mobile. Shellcontroller "xmlns:l=" Sap.ui.layout "xmlns:u=" sap.ui.unified "xmlns:mvc=" Sap.ui.core.mvc "xmlns=" sap.m "class=" viewpadding "> <u:shell id=" Myshell "icon=" {/logo} "> < u:headitems> <u:shellheaditem tooltip= "Configuration" icon= "
Sap-icon://menu2 "press=" handlepressconfiguration "/> <u:shellheaditem
tooltip= "Home" icon= "Sap-icon://home" visible= "false" press= "Handlepresshome"/> </u:headItems> <u:headEndItems> <u : Shellheaditem icon= "Sap-icon://log" tooltip= "Logoff" press= "H
Andlelogoffpress "/> </u:headEndItems> <u:user> <u:shellheaduseritem image= "Sap-icon://person-placeholder" username= "Karl M Ustermann "press=" handleuseritempressed "/> </u:user> <u:search>
; <searchfield search= "handlesearchpressed"/> </u:search> <u:pane
content> <text text= "Lorem ipsum"/> </u:paneContent> </u:Shell> </mvc:View>
Reference:
http://stackoverflow.com/questions/31470506/ When-to-use-shell-app-container-page-view-and-splitapp-in-sapui5