Skip to Content
0
May 12, 2016 at 08:02 AM

Get Html id

262 Views

Hello Guys,

I have create SAPUI5 App and add iconTabBar like

var iconbar = new sap.m.IconTabBar({

expanded : "{device>/isNoPhone}",

select : function(){

oController.selectedTab();

},

items : [

new sap.m.IconTabFilter({ // Icon

icon : "sap-icon://hint",

text : 'map',

key : i,

content : [ new sap.ui.core.HTML(

{

content : "<div id='map_canvas' style='width:800px; height: 320px;'></div>",

// preferDOM : true, // boolean

}

),

]

// Detail off pertiqular tab

})

],

})

And add HTML using sap.ui.core.HTML and but is my controller side i can't access or get my div id

selectedTab :function(){

alert('selectedTab');

var mapDiv = sap.ui.getCore().byId("map_canvas");

//var mapDiv = this.getView().byId("map_canvas");

alert(mapDiv);

alert(document.getElementById("map_canvas") );

},

but i get null. so please help me where i going wrong.