|
Dear Diplaytag developers,
I really like your display tag, it looks nice and is easy to use, I have just one problem: I don’t think I understand the sorting mechanism properly. How can I sort on different values in a table?
I have for instance a column with ints, another column with strings and third column with percent etc. all values are members of the same java class.
Your examples explain that you will have to implement the Comparable interface, but this will normally just compare the class instances and not depending on the value in the row. So, could you please help me with how to do this?
from code------------------------------------------------------------------------------------------
My result now is that, even if I set “sortable=true” on each row, it always sorts by one value, the row.rule.id. SearchResults is a wrapper class that wraps the object called rule and contains among other members an id, and a hits (percent) member.
<display:table name="pageScope.searchResults" id="row" pagesize="100" cellpadding="0"> ��� ������� <display:column title="Hits" sortable="true"� width="5%">������� ����������� <a href="" value="${getURL}${row.rule.id}"/>"> ��������������� <c:out value="${row.hitPercent}"/> ����������� </a> �</display:column>��� �<display:column href="" title="Nummer" sortable="true" width="8%"> ������� <a href="" value="${getURL}${row.rule.id}"/>"> ����������� <c:out value="${row.rule.number}"/> ������� </a> � </display:column>
etc..
Best regards, Martha |

