I have a scenario where in implemented the CustomDataRetriever for the data column modifier data to be populated, as we have some 2000-5000 records of data we are forced to go for customdataretriever.
My problem now here is when i enable the sorting in the data column modifier, the link is coming on the header, but when i click on the link/header the data remains in same order, its not sorting as expected.
If anyone have faced this issue earlier/ have some solutions/ideas for this issue, please help me out in this regard. Thanks in advance.....
Pinned topic Custom Data Retriever for Data Column modifier - Sorting not working
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-11-15T20:23:11Z at 2012-11-15T20:23:11Z by kevintap
kevintap 100000QN03753 Posts
Re: Custom Data Retriever for Data Column modifier - Sorting not working2012-01-05T15:42:12ZThis is the accepted answer. This is the accepted answer.When you extended the CustomDataRetriever base class, did you override the default implementation of the sort method (from the SortableData interface)?
public boolean sort(String sortBy, String sortType, boolean ascending);
This sort method is called to allow the paged data retriever to attempt to sort the data in an efficient manner. The default implementation of sort simply returns false, which means that sorting is not supported. In order to properly support sorting, this method must re-fetch data from the back end system in a sorted manner and return true.
As an example, if this data retriever was obtaining data from a SQL database the implementation of this sort method would need to do something like this:
1) append "ORDER BY sortBy" to the base SQL query
2) re-execute the SQL query
3) fetch the first batch of results from the result set
4) return true from the sort method
saikiran 060000AFWX20 Posts
Re: Custom Data Retriever for Data Column modifier - Sorting not working2012-11-15T11:54:07ZThis is the accepted answer. This is the accepted answer.
- kevintap 100000QN03
I tried the approach. In the sort method if I return the flag true, then It internally calling the getResultData with argument value 0.
So in sort method I am storing the sort method argument into the object members and returning true. And in getResultData I am calling the services to get the sorted result.
In the page it is always going to page1. Is this correct way of doing it?
Is there any way to stay in the current page after sort?
kevintap 100000QN03753 Posts
Re: Custom Data Retriever for Data Column modifier - Sorting not working2012-11-15T20:23:11ZThis is the accepted answer. This is the accepted answer.
- saikiran 060000AFWX
The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.