cancel
Showing results for 
Search instead for 
Did you mean: 

UI.Table is empty even though binding exists.

0 Kudos

I have a ui.table and I bind a JSON model to it. That worked fine the whole time but apparently I made some changes that caused the data to disappear. When getting the binding of the table, I see data but the bindingContext is "undefined".

I'm also applying a rowSettingsTemplate and that gets applied correctly. So e.g. 4 of my rows are highlighted and it's exactly the rows that should be highlighted. So somehow the data is there but it's simply not shown..

2019-04-01-13h07-07.png

This is my code:

var changedModel = new sap.ui.model.json.JSONModel();
// merge new, update and remaining data in one model
var changedData =  _.concat(insert, update, remaining);
changedData = _.sortBy(changedData, [function(o) { return Object.values(o)[0]; }]);
var oColumns =  this.getColumnNames(changedData); 
changedModel.setData({ 
	columns: oColumns, 
	rows: changedData, 
});
backendTable.setModel(changedModel, "changedModel");
// highlighting for new/update data
var rowSettingsTemplate = new sap.ui.table.RowSettings({ 
	highlight: {
		path: "changedModel>highlight",
		formatter: formatter.checkHighlight
	}
});
backendTable.setRowSettingsTemplate(rowSettingsTemplate);
// bind rows
backendTable.bindRows("changedModel>/rows");

Please let me know anything I'm doing wrong..

prabhatp
Participant
0 Kudos

Could you share how your table and its bindings are defined?

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member322772
Active Participant
0 Kudos

Would need to see the code for the view. Usually if you see a certain number of rows but no data it means the binding to the model is incorrect for the fields in the table.