Hi, I want to take this as offline as it is not related to struts.
Thanks a lot for your effort for making me understand.
Does it mean that we need to do the sort for all the objects or is it a
bulk sorting available from java package? I believe the sort takes only
two objects and tells which is smaller and which is bigger. I'm looking
for a bulk sorting functionality.

Through me some ideas if u ave.
Anil.
-----Original Message-----
From: Lance [mailto:[EMAIL PROTECTED]
Sent: Monday, July 17, 2006 6:29 PM
To: 'Struts Users Mailing List'
Subject: RE: Dynamic Sort depending on the field requested by user.

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]


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]

Reply via email to