Hi guys,
I have a simple app where on the UI there is a table that is bound to a model. The problem is that once the model is saved in Core with a name, the UI binding does not work. Anyone knows why? Thanks.
Here is the code just using one table on UI:
///Model:
var myModel = new sap.ui.model.json.JSONModel();
var myData = {};
myData.ListItems = [{FirstName: "David1", LastName:"Jim1"},{FirstName: "David2", LastName:"Jim2"}];
myData.count = myData.ListItems.length;
myModel.setData(myData);
sap.ui.getCore().setModel(myModel,"myModel1");
///View:
var oTable = new sap.ui.table.Table({
visibleRowCount:"{/count}",
.....
});
new sap.ui.table.Column({
new sap.ui.commons.TextView().bindProperty("text", "myModel1>FirstName"),
.....});
oTable.setModel(sap.ui.getCore().getModel("myModel1"));
oTable.bindRows ("myModel1>/ListItems");
NOTES: when the model is saved in Core without name, it works fine.