Skip to Content
0
Jan 10, 2023 at 10:39 PM

Getting all values of a column from a SAP UI5 table with more than 1000 rows

865 Views

I have a SAP UI5 table with 8 columns. The table selection mode is MultiToggle so that we can select multiple rows at once.

I am able to show all the 1088 rows on the SAP UI5 screen.

When there are less number of rows, selecting all rows works. But for the count of 1088, the code is not working to retrieve a column value.

 

onPress: function (oEvent)

{

var aIndices = this.byId("idTable1").getSelectedIndices();

var oModel = this.byId("idTable1");

var tmp_obj = {};

var tmp_arr = [];

for (var i = 0; i < aIndices.length; i++)

{

var idx = aIndices[i];

// var oData1 = oModel.getContextByIndex(idx).getModel().oData;

var selectedvalue = oModel.getContextByIndex(idx).getObject("COLUMN1");

// var selectedvalue= oModel.getRows()[idx].getCells()[0].getText();

tmp_obj = {

"COLUMN1": selectedvalue

};

tmp_arr.push(tmp_obj);

tmp_obj = {};

}

When I select the header checkbox which means I select all rows of the SAP UI5 table it fails with an exception at index 110 ( for the row 111) at oModel.getContextByIndex(idx).getObject("COLUMN1");

image.png

Looks like getContextByIndex will not work to get all rows column value when the row count is higher. It sends multiple requests image.png
How do I get all rows first column value without using getContextByIndex?

Attachments

image.png (51.3 kB)
image.png (36.8 kB)