Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Struts 2.0 and display tag sorting

    hi,

    '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 !

  • #2
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Issue fixed

    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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •