Hello, Dayananda B V!
Unfortunatelly you canot use getRows() for that aim. But there is a trick, you can apply for your purpose. In the event handler you can do the following:
HtmlGridView grid = (HtmlGridView) e.getComponent();
List data = (List)
grid.getDataSource().getWrappedData();
where data is the actual underlying data source (not limited by page size). Then you have the page size and the new page index, accordingly:
int
pageSize = grid.getPageSize();
int
newIndex = e.getNewPageIndex();
By having the whole data list for the data source, the new index and the page size, you can now estimate the list of rows for the current page:
int startIndex = newIndex * pageSize;
int endIndex = startIndex + pageSize - 1;
Now you can iterate through the list containing all rows (data), starting from the startIndex and ending with the endIndex and get the property you need, in my example:
for(int i = startIndex; i <= endIndex; i++){
Clients client = (Clients) data.get(i);
str += ((Clients) data.get(i)).getId() + "; ";
}
and display the values
msg
= "Clients on page: " + str;
Thanks!
-- Bozhidar