问题
I think I may be expecting too much from a viewPanel Control (8.5.2), but want to confirm my suspicion. I have a domino view that has the first three columns sorted ascending and has the "click on column to sort" enabled and set to "both". When I simply display the view using a viewPanel and do not use the search and sort properties of the viewPanel, the display is sorted first by column 1, then by column 2, then by column 3. All ascending and pretty. But, since I only want a subset of records presented, I use the "search" property of the viewpanel to search for a value in the first column and only return the records with the values that match. At that point, I get the records that I want but I lose all the sorting. So - I use the sort property to get the records sorted on the second column which is nice and works although for some reason I have to set the "sortOrder" explicitly to ascending or the order defaults to descending. I would really like to have that 3rd column sorted as well. Should I dump the viewPanel and work with a Datapanel or Repeat control? Thanks, ---Lisa&
回答1:
Have you tried a key filter instead of search? It filters on the first sorted column, and as far as I remember it is leaving all the sorting intact.
Drawback here is that this may not work as expected for sortable columns.
Apart from that I totally agree with Paul in regards to Domino 8.5.2; I feel that even 8.5.3 is a pain to program for, but that version at least still is getting fixes.
回答2:
Domino 8.5.3 provided the FTSearchSorted() method, which will give you what you need.
I'm afraid 8.5.2 is extremely limited in many areas, not least the inability to use Extension Library. The POODLE fix was not provided for 8.5.2, just 8.5.3. And I believe Domino 8.5.2 also does not work on Internet Explorer 9 unless using compatibility mode (because of the Dojo version), which limits positioning settings. I do not recommend anything prior to 8.5.3 for XPages development for my customers and highly recommend 9.0.1.
回答3:
Because I only need the output sorted on the second column the first time the page is accessed, I decided to use a session variable to filter on the first column. The initial output sorts on the second column and after that on the third column. Subsequent searches set the filter variable to null and used the search/sort functionality to return all items returned in the original search that also matched other criteria. These results only need to be sorted on the third column. If the user clears the search, the search variables are set to null and the filter variable is set to the original value. I am looking forward to our upgrade to version 9.
来源:https://stackoverflow.com/questions/32358319/xpages-viewpanel-searching-and-sorting