View Data Source: Sorting your full-text search results
December 1, 2014
Posted by on
This post is thanks to my colleague Daniel Soares.
Daniel had created a repeat control based on a view, which displays data after the user did a search by name. As is common, the result list was unsorted, even though the first column in the view is sorted.
Looking at the data properties of the panel, there is an option for a sort column:
After setting that property with the column name, opening the XPage in the browser and executing a search, Daniel would get an error 500.
According to a post by Niklas Heidloff, sorting search results was supposedly added with release 8.5.3
So, Daniel did some more digging and came across this post in the XPages Development Forum:
Notice the post by Bob Cross at the bottom of the thread? Apparently, in order for the “Sort Column” property to work without throwing an error 500, you have to check the box “Click on column header to sort” in your view’s column property on any column that you’d like to use for that:
That’s exactly, what solved this issue and the search result was sorted. Who would have thought?
Thank you Dan and thank you Bob Cross.