Skip to Content
0
Former Member
Jul 25, 2013 at 01:49 PM

TileContainer and weird behaviour together with App and Page

43 Views

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?