SAPUI5 Shell calls App,app to navigate

Source: Internet
Author: User
Tags xmlns

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&gt
                ; <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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.