Struts 2.0 and display tag sorting
'm using display tag with struts 2.0, want to sort multiple columns having multi levels of sorting? any ideas would be helpful
THANKS IN ADVANCE !
hi friends, this issue is fixed,
You just have to do a sort="external" in the table tag.(After doing this your display table tag wont sort your list.)
then you have to...
1) write a comparator class.
2) write the multilevel compare logic in comparator.
3) sort your list before setting in action class, using collections.sort or arrays.sort invoking the previous comparator you made.
EXAMPLE - Arrays.sort(customArray, new YourComparator(Column_Name, Sort_Order));
and voila ! you got sorting done. :)
|All times are GMT +1. The time now is 01:08 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.