I have a primefaces datatable with live scrolling enabled, i have assigned the attribute scrollRows to 50.But since it is having more than 50 columns it is taking more time for next set of 50 records to get loaded when i reach the end of scrolling.Is there any way by which initially on page load i load only 50 records and then at the end of scroll i load small number of records say 5 or 10.
I cannot speak specifically to Primefaces, but I don't do this kind of thing on page load. I do it on the first call to the DataModel "get" method, then cache the results so that subsequent "get"s for that DataModel property return the cached DataModel. That is especially important since the "get" method might get called up to 6 times for a single page render operation - not counting other references made to it on the same View Definition.
So you have 2 parts to what you want to do: one to fetch data and construct DataModel for it, another to handle paging requests. There should be a Primefaces attribute you can set to cause an action to fire when the user clicks a paging button.
Using the cached DataModel method I described, handling the paging is relatively simple: just make the page-navigation method(s) adjust the starting point for the data fetch and null out the DataModel property. Since the first thing that the DataModel's "get" method does is check for a null Model and construct one if it's null, that's where you'd get your refreshed data.
An IDE is no substitute for an Intelligent Developer.