Display tag works great for me. The only problem iam having 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.
I have orridden compareTo method in my Business object, but when I do sorting it displays as for example
A
B
C
a
b
It shud be DISPLAYED as:
A
a
B
b
C
I tried to print my results with out using display tag it works fine for me.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I found the solution , 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 as: [code]
public String getCaseInsensitiveData() { return getData().toLowerCase();} [/code]
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.
Just my two cents, since I just ran into the same problem. create a Class to implement Comparator. and use that in the column as comparator="xxx.xxxx.CaseInsensitiveComparator" will work. see DefaultComparator for code.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
Tables can be displayed vertically ...fine.But,I want to display them vertically as shown below.
NAME a b c
PHONE 1 2 3
etc
I had previously posted the same problem.Please help me.
Thanks and regards
Yogesh RK
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Display tag works great for me. The only problem iam having 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.
I have orridden compareTo method in my Business object, but when I do sorting it displays as for example
A
B
C
a
b
It shud be DISPLAYED as:
A
a
B
b
C
I tried to print my results with out using display tag it works fine for me.
I found the solution , 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 as:
[code]
public String getCaseInsensitiveData() { return getData().toLowerCase();}
[/code]
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.
Related
Code: code
Just my two cents, since I just ran into the same problem. create a Class to implement Comparator. and use that in the column as comparator="xxx.xxxx.CaseInsensitiveComparator" will work. see DefaultComparator for code.
Hi all,
Tables can be displayed vertically ...fine.But,I want to display them vertically as shown below.
NAME a b c
PHONE 1 2 3
etc
I had previously posted the same problem.Please help me.
Thanks and regards
Yogesh RK