evrencoskun / TableView

TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
MIT License
3.15k stars 457 forks source link

java.lang.IndexOutOfBoundsException in setRowHeaderItems #393

Open ghost opened 3 years ago

ghost commented 3 years ago

Everytime I try to repopulate the tableview with a new dataset i get the IndexOutOfBoundsException.

adapter.setAllItems(model.getColumnHeaderList(), model.getRowHeaderList(size), model.getCellList(list));

asa421 commented 1 year ago

Are you using pagination?

If pagination is attached, then the listeners do not have time to update the arrays of strings and cells, and when updating the data, the private method private void paginateData() is called, inside which IndexOutOfBoundsException.

pagination.setItemsPerPage(0); // !!!Pagination return IndexOutOfBoundsException
adapter.setAllItems(model.getColumnHeaderList(), model.getRowHeaderList(size), model.getCellList(list));
pagination.setItemsPerPage(100); // Your number of lines