Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-10-2008, 11:58 AM   PM User | #1
Robin John
New to the CF scene

 
Join Date: Sep 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Robin John is an unknown quantity at this point
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 !
Robin John is offline   Reply With Quote
Old 09-25-2008, 12:23 PM   PM User | #2
Robin John
New to the CF scene

 
Join Date: Sep 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Robin John is an unknown quantity at this point
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.
Robin John is offline   Reply With Quote
Reply

Bookmarks

Tags
display tag, sorting display tag, struts 2.0

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:22 AM.


Advertisement
Log in to turn off these ads.