Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9164

Re: Navigation between pages using Standard tile in a tile container using MVC architecture in SAPUI5

$
0
0

Hi,

 

I am not even able to see anything in the screen when I follow what you have mentioned. Any idea what may be the reason?

 

My index.html

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="X-UA-Compatible" content="IE=edge">

 

 

<script src="resources/sap-ui-core.js" id="sap-ui-bootstrap"

          data-sap-ui-libs="sap.m,sap.me,sap.ui.commons"

          data-sap-ui-theme="sap_bluecrystal">

</script>

 

 

<script>

          sap.ui.localResources("sapui5test");

 

          var page = sap.ui.view({

                    id : "idmytestview1",

                    viewName : "sapui5test.mytestview",

                    enableScrolling : false,

                    type : sap.ui.core.mvc.ViewType.JS

          });

 

 

          var app = new sap.m.App("myApp", {

                    initialPage : "idmytestview1"

          });

 

 

          app.addPage(page);

          app.placeAt("content");

 

</script>

 

 

</head>

<body class="sapUiBody" role="application">

          <div id="content"></div>

</body>

</html>

 

My view js

 

createContent : function(oController) {

                    var App = new sap.m.App({ id:"App"});

                    App.placeAt("content"); 

 

 

                    var Page = new sap.m.Page({title:"Welcome!",id:"Page",enableScrolling: false});

                    App.addPage(Page); 

 

 

                    var oContainer = new sap.m.TileContainer({});

                    Page.addContent(oContainer);

 

 

                    var T1 = new sap.m.StandardTile("Tile1",{icon :"/imgc",

                              title:"App1",

                              press:onPress

                    });

                    oContainer.addTile(T1); 

 

                    var T2 = new sap.m.StandardTile("Tile2",{icon :"/imgc",

                              title:"App2",

                    });

                    oContainer.addTile(T2);

 

 

                    function onPress(){

                              alert("before");

                              app = sap.ui.getCore().byId("myApp");

                              app.to("idView_22");

                              alert("after");

                    };

          }

 

 

My control init function

 

 

 

          onInit: function() {

                    var page1 = sap.ui.view({

                              id:"idmytestview2",

                              viewName:"sapui5test.mytestview",

                              enableScrolling: false,

                              type:sap.ui.core.mvc.ViewType.JS});

                    App.add(page1);

          },

 

Thanks and regards

Surya


Viewing all articles
Browse latest Browse all 9164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>