Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

TileContainer and weird behaviour together with App and Page

$
0
0

Hi,

 

I'm having some weird behaviour with TileContainer which I cannot explain.

 

Below are three examples that ought to work the same. However, only alternative 2 actually works

 

//Alternative 1: Doesn't work (shows no tiles)
var App = new sap.m.App({ id:"App"});
App.placeAt("content"); 

var Page = new sap.m.Page({title:"Home",id:"Page"});
App.addPage(Page); 

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

var T1 = new sap.m.StandardTile({title:"T1"});
oContainer.addTile(T1); 
var T2 = new sap.m.StandardTile({title:"T2"});
oContainer.addTile(T2);


//Alternative 2: Works (shows the two tiles as expected)
var T1 = new sap.m.StandardTile({title:"T1"});
var oContainer = new sap.m.TileContainer("tilecontainer", {tiles:[T1]});

new sap.m.App({
                                  pages: [                                            new sap.m.Page({                                                      title: "Home",                                                      content: [ oContainer ]                                            })                                  ]                        }).placeAt("content");

var T2 = new sap.m.StandardTile({title:"T2"});
oContainer.addTile(T2); 

//Alternative 3: Doesn't work (shows no tiles)
var T1 = new sap.m.StandardTile({title:"T1"});
var oContainer = new sap.m.TileContainer("tilecontainer", {tiles:[T1]});

var MyPage= new sap.m.Page({
          title: "Home",          content: [ oContainer ]
});
new sap.m.App({                                  pages: [                                            MyPage                                  ]                        }).placeAt("content");

 var T2 = new sap.m.StandardTile({title:"T2"});
oContainer.addTile(T2);

 

Does any one have an explanation for this?


Viewing all articles
Browse latest Browse all 6178

Trending Articles



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