You need to sign in to do that
Don't have an account?
StandardSetController getSelected() - How can I retain Sort Order from List View?
I have a controller extension for a list view.
The user selects a subset of the items in the list and clicks a button that goes to my custom VF Page.
I want to retain the order they were selected in the list from top to bottom. So if Selected Item A is before Selected Item B when the button is clicked, that is the order I WANT them passed to the controller.
However, the method getSelected() on the StandardSetController does not return the items in a sorted list the same as the screen.
Does anyone know how to keep the selected items sorted from the previous pages list view?
Hy Cory,
have you found an answer to your question? I am struggling with selection in StandardSetController-managed PageBlockTables for weeks.
My currently unanswered post is here:
http://boards.developerforce.com/t5/Visualforce-Development/Select-rows-in-PageBlockTable-when-using-ApexPages/m-p/387199
Best regards
Rsoese
Hy Cory,
have you ever tried to use a Map instead of Wrapper classes when it comes to selecting rows of a StandardSetController? Something like this:
That's odd, the getSelected() method returns a list of sObjects, which should be ordered...maybe it's generating a second list that doesn't preserve the same order?
Does anyone know how to capture the current list views sort order? If I could do that then just apply it to the selected collection set.