This content has been marked as final.
Show 3 replies
-
1. Re: Exporting a sorted (!) datatable to PDF
aparij Oct 7, 2008 10:32 AM (in response to tuestone)Well , for me even out of the box alphabetical sorting is not working ( (but auto-sorting is working).
Did you manage to make it sorted while you press the "sort arrow" ?
If you familiar with "Charles" very helpfull tool to debug your http session. From what I saw the list in session in never sorted , but the response to the AJAX request should contain the sorted table.
Hope it helps somehow.... -
2. Re: Exporting a sorted (!) datatable to PDF
tuestone Oct 8, 2008 4:14 AM (in response to tuestone)Hi aparij,
thanks for your response.
I am not quite sure what you mean by "out of the box" sorting vs. auto-sorting. For me, something like<rich:column sortBy="#{Item.change}" sortable="true" selfSorted="true">
(where "change" is a String property) is working fine and is correctly sorted in alphabetical order when pressing the sorting arrow. I suppose that is what you mean by out of the box sorting?
I agree with your assumption that the list in session never really gets sorted. The compare method in my comparator just compares all objects from that list to each other so the result is just temporary:public int compare(LogItem o1, LogItem o2) { int ret = 0; if (ordering == Ordering.ASCENDING) { if (o1.getDate().after(o2.getDate())) ret = -1; else if (o2.getDate().after(o1.getDate())) ret = 1; } else { if (o2.getDate().after(o1.getDate())) ret = -1; else if (o1.getDate().after(o2.getDate())) ret = 1; } return ret; }
So I don't know if there is a sorted list in a HTTP response in some way. But if there is, how can I access that list from that response? -
3. Re: Exporting a sorted (!) datatable to PDF
tuestone Oct 8, 2008 4:21 AM (in response to tuestone)Oh, and thanks for your recommendation "Charles". Never heard of it before...