You can handle sorting yourself or work with display tags. See http://displaytag.sourceforge.net/11/

Thanks,
Vijay Venkataraman

Lance wrote:

For arrays, use java.util.Arrays.sort(Object[], java.util.Comparator)

-----Original Message-----
From: Lance [mailto:[EMAIL PROTECTED] Sent: 17 July 2006 13:57
To: 'Struts Users Mailing List'
Subject: RE: Dynamic Sort depending on the field requested by user.

Ok... chances are your form has a java.util.List that you want sorted. You
can use java.util.Collections.sort(java.util.List, java.util.Comparator)
I think commons-collections or commons-lang has a BeanComparator that you
can use to sort beans by their properties. You can write your own custom
java.util.Comparator too.

-----Original Message-----
From: Anil Kumar T [mailto:[EMAIL PROTECTED] Sent: 17 July 2006 13:45
To: Struts Users Mailing List
Subject: RE: Dynamic Sort depending on the field requested by user.


But I need the dynamic sort logic ?

Anil.

-----Original Message-----
From: Lance [mailto:[EMAIL PROTECTED]

Sent: Monday, July 17, 2006 6:11 PM
To: 'Struts Users Mailing List'
Subject: RE: Dynamic Sort depending on the field requested by user.

I don't store the sort column, I pass it in a parameter.
Eg your table heading may have a link similar to
<a href="path/to/sortAction.do?sortColumn=name&sortDirection=ascending">



-----Original Message-----
From: Anil Kumar T [mailto:[EMAIL PROTECTED]

Sent: 17 July 2006 13:35
To: Struts Users Mailing List
Subject: RE: Dynamic Sort depending on the field requested by user.


Hi Lance,

Thanks for the response. I'm looking at some thing like this. But I'm
not getting how to store the values? When the user clicks on any column
how do we do the sorting..? can you send me sample piece of coding.

Regards,
Anil.

-----Original Message-----
From: Lance [mailto:[EMAIL PROTECTED]

Sent: Monday, July 17, 2006 4:22 PM
To: 'Struts Users Mailing List'
Subject: RE: Dynamic Sort depending on the field requested by user.

I do this with 2 actions which use the same form which has a scope of
"session". The first (retrieve) action hits the db and populates a form.
The
second (sort) action just sorts the form (retrieved from the session).
On
your html table, the column headings link to your "sort" action.

-----Original Message-----
From: Anil Kumar T [mailto:[EMAIL PROTECTED]

Sent: 14 July 2006 08:11
To: Struts Users Mailing List
Subject: Dynamic Sort depending on the field requested by user.


Hi Group,




I have a requirement like I need to display a list containing Name,
Date, Department, Last update etc., after displaying the list the user
can select any field to sort the list display, but it should not query
again, only with the first time result we should be able to provide the
sort order as per user request. He can request the sort order on any
field. Can any one know how to achieve this with struts? Any help, links
would be appreciated highly.




Thanks in advance,

Anil.



Information transmitted by this e-mail is proprietary to Infinite
Computer
Solutions and / or its Customers and is intended for use only by the
individual or the entity to which it is addressed, and may contain
information that is privileged, confidential or exempt from disclosure
under
applicable law. If you are not the intended recipient or it appears that
this mail has been forwarded to you without proper authority, you are
notified that any use or dissemination of this information in any manner
is
strictly prohibited. In such cases, please notify us immediately at
[EMAIL PROTECTED] and delete this email from your records.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Information transmitted by this e-mail is proprietary to Infinite
Computer
Solutions and / or its Customers and is intended for use only by the
individual or the entity to which it is addressed, and may contain
information that is privileged, confidential or exempt from disclosure
under
applicable law. If you are not the intended recipient or it appears that
this mail has been forwarded to you without proper authority, you are
notified that any use or dissemination of this information in any manner
is
strictly prohibited. In such cases, please notify us immediately at
[EMAIL PROTECTED] and delete this email from your records.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Information transmitted by this e-mail is proprietary to Infinite Computer
Solutions and / or its Customers and is intended for use only by the
individual or the entity to which it is addressed, and may contain
information that is privileged, confidential or exempt from disclosure under
applicable law. If you are not the intended recipient or it appears that
this mail has been forwarded to you without proper authority, you are
notified that any use or dissemination of this information in any manner is
strictly prohibited. In such cases, please notify us immediately at
[EMAIL PROTECTED] and delete this email from your records.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



------------------------------DISCLAIMER------------------------------
This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Lisle Technology Partners Pvt. Ltd. and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to