admin@glassfish.java.net

Re: tablecolumn date sort

From: Anissa Lam <Anissa.Lam_at_Sun.COM>
Date: Tue, 20 Jan 2009 21:10:46 -0800
HI Claudio,

Maybe sorting won't work with the Date object,  i never tried that.  What i did was having a hidden value which corresponds to the Date that is displayed to the user,  and sort that column by its corresponding millis.
 
something like:

<sun:tableColumn
headerText="$resource{i18n.cert.server.table.col_expdate}"
sort="exp_date_in_millis" rowHeader="$boolean{true}" id="col3">
   <staticText id="typeContextRoot" value="#{td.value.exp_date}" />
</sun:tableColumn>
so, for each td.value.exp_date,  there is the corresponding td.value.exp_date_in_millis  for sorting.

Hope this help.
Anissa.

Claudio Miranda wrote:
ping

On Sat, Jan 17, 2009 at 4:48 PM, Claudio Miranda
<claudio@claudius.com.br> wrote:
  
Is it possible to sort a tableColumn with Date values ?
I did some test with the code below, but it doesn't work.

<sun:tableColumn
headerText="$resource{i18n.cert.server.table.col_expdate}"
sort="exp_date" rowHeader="$boolean{true}" id="col3">
   <staticText id="typeContextRoot" value="#{td.value.exp_date}" />
</sun:tableColumn>

The glassfish version is v3 build 31