Hi All,
I want create simple view object and then try to add control in it as follows
var myView = new sap.ui.core.mvc.View();
for(var j=0;j<oModel.oData.Groups[i].Products.length;j++)
{
var detailView= sap.ui.view({
viewName : "MyDirectory.CustomView",
type : sap.ui.core.mvc.ViewType.JS
});
detailView.bindElement("/Groups/"+i+"/Products/"+j);
myView.insertContent(detailView,j);
}
myView.addStyleClass("productsContainer");
But when I create object "myView" it gives error: Cannot read property 'viewData' of undefined
It never enter in for loop
Can any body show me how to create view object and Add content or control in it.