This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer (Exam 1Z0-830) Java SE 17 Developer (Exam 1Z0-829) Programmer’s Guide and have Khalid Mughal and Vasily Strelnikov on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Display tag and sorting

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Display tag library provided by Sourcefourge.net for pagination, It works great for me. The problem is it doesn't do the sorting independent of upper case and lower case. I want to do the sorting independent of upper case and lower case.
Does any one used this tag library before and solved this problem or somebody know how can I solve this issue ??
thanks to all.
 
Sheriff
Posts: 28401
100
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tracked down the documentation and read it.

If you want a fix now, then you should add another property to your beans that contains a version of your strings in all lower-case and use that property as the sortProperty attribute. Something as simple asshould work. Or you could volunteer to work on the project and add new attributes that allow providing a Comparator or a Collator to the sort. It is open-source so you could do that.
 
shailesh kumar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply but the solution which you gave me is to convert all the data to lower case, thats not what I want. I am sorry If was unable to explain properly. Here is the example.
This is my data:

A
a
B
b
C
c
D
d

My Business Object has this data and initially it displays as shown above which is independent of uppercase and lowercase. When I click on this column to do the sorting using display tag, it displays as

A
B
C
D
a
b
c
d

This is the problem it should do the sorting independent of case.
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't worked on Display tag library but if you follow the lines of Paul you must be able to do case insensitive sorting.

Assuming the tag library sorts on all java objects you can do the following:

- Create a Wrapper for the data you want to perform case insensitive sorting as shown below:



And use this wrapper class in the display object.
[ January 19, 2006: Message edited by: Purushothaman Thambu ]
 
Paul Clapham
Sheriff
Posts: 28401
100
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shailesh kumar:
Thanks for the reply but the solution which you gave me is to convert all the data to lower case, thats not what I want. I am sorry If was unable to explain properly.

Obviously I didn't explain properly either.

I understood your explanation. The code I posted was not intended to convert all the data to lower case, and in fact it does not do that. It just provides a separate property in your bean that you can use for sorting. Only for sorting. Do not use this property for displaying. Display the "data" property but sort on the "caseInsensitiveData" property.
 
shailesh kumar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, I got it..
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shailesh,

It would be helpful if you can tell us how you fixed this problem.

Thanks
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic