Columns are generated dynamically. They do not contain any dates.
They contain tags like 1b for 1 business day and 2b for 2 business
days, 1m for 1 month , 2y for 2 yrs etc... That will be a part of the
column name and not the full column name.
I need to sort that in the chronological order as 1b,2b, 1m, 2m, 3m,
1y,2y,etc... How to do that in JSP?
tom fredriksen - 23 Feb 2006 13:03 GMT
> Columns are generated dynamically. They do not contain any dates.
> They contain tags like 1b for 1 business day and 2b for 2 business
> days, 1m for 1 month , 2y for 2 yrs etc... That will be a part of the
> column name and not the full column name.
> I need to sort that in the chronological order as 1b,2b, 1m, 2m, 3m,
> 1y,2y,etc... How to do that in JSP?
you could use a days tag of days instead of 1b, 2b, 1m etc, you use
1..365. That way you can sort it by using normal tools. If the tags
needs to be displayed for some reason, attach a text which can be used
for each tag or group of tags.
/tom
Marcin Jaskólski - 23 Feb 2006 14:27 GMT
> Columns are generated dynamically. They do not contain any dates.
> They contain tags like 1b for 1 business day and 2b for 2 business
> days, 1m for 1 month , 2y for 2 yrs etc... That will be a part of the
> column name and not the full column name.
> I need to sort that in the chronological order as 1b,2b, 1m, 2m, 3m,
> 1y,2y,etc... How to do that in JSP?
Have a look at:
java.util.Comparator interface and
void java.util.Arrays.sort(Object[] arg0[], Comparator arg1)
Basically, a class implementing the Comparator interface is used to
define an order on objects. You will have to implement method comparing
the column names to your liking.
Then... just call the sort method :-)

Signature
Pozdrawiam,
Marcin
Roedy Green - 23 Feb 2006 15:29 GMT
On Thu, 23 Feb 2006 15:27:48 +0100, Marcin Jaskólski
<no.email@provided.com> wrote, quoted or indirectly quoted someone who
said :
>Have a look at:
>
>java.util.Comparator interface and
>void java.util.Arrays.sort(Object[] arg0[], Comparator arg1)
see http://mindprod.com/jgloss/comparator.html
http://mindprod.com/jgloss/sort.html
http://mindprod.com/jgloss/generics.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.