You need to sign in to do that
Don't have an account?
IdeaStandardSetController getResultSize() method returns unexpected results
Working with a large client that is using Ideas Base Theme. We're having Pagination issues using the IdeaStandardSetController. We are using the <ideas:listOutputLink> control to pass a status,sort, category, and communityId to navigate to our vforce page that lists the ideas that match the params. The IdeaStandardSetController for the page seems to read the params for sort,category,community,and status fine and displays the proper ideas that match the parameters. However, we're trying to display pagination at the bottom of the page that shows "Idea Page 1 of ###". In order to determine the ### number we're doing a call to the controller.getResultSize() method but it always returns the number for the entire set of all ideas not taking into consideration the parameters for sort,category,status. So even when the IdeaStandardSetController only displays 1 record in the list the getResultSize() method still returns 700+ ideas.
Is this a problem with the IdeaStandardSetController or are we just not using it correctly to determine the number of ideas that fit the params?
" Even though the IdeasStandardSetController extends from the StandardSetController, the implementation is different for the ideas controller and hence the methods which get inherited from StandardSetController will not be in sync with the results from the IdeasStandardSetController. This behavior has been documented in the VisualForce user guide under the IdeasStandardSetController class.
Unfortunately, the ideas set controller implementation does not give you an option to find out the total number of results in advance.
It supports only pagination of one page at a time."
All Answers
" Even though the IdeasStandardSetController extends from the StandardSetController, the implementation is different for the ideas controller and hence the methods which get inherited from StandardSetController will not be in sync with the results from the IdeasStandardSetController. This behavior has been documented in the VisualForce user guide under the IdeasStandardSetController class.
Unfortunately, the ideas set controller implementation does not give you an option to find out the total number of results in advance.
It supports only pagination of one page at a time."
I have the same problem using StandardSetController which I am able to solve by this code:
save your filtered record list in result variable
result = (your sorted records);
controller =newApexPages.StandardSetController(results);
controller.setPageSize(10);
controller.getRecords();