[ http://jira.codehaus.org/browse/DISPL-203?page=comments#action_38152 ]
     
Narayanan A commented on DISPL-203:
-----------------------------------

Hello, 

I managed to solve this one with some work-aound. There is a condition in the 
compare method of RowSorter class, this logic checks for the decorator and the 
getterMethod of the property. If a getterMethod is found for the property it 
uses the decorated value for sorting and not the underlying object. In my case 
the underlying object was java.util.Date ,but it was always sorting based on 
the decorated value instead of the object. 

Please find my work-around for this problem. 
Added a new dummy Property with attribute sortProperty=originalProperty and 
added a getterMethod for the dummyProperty in my decorator class. Please find 
the attached file work-around.txt. 

Can we have an attribute something like "sortByObject=true" in future release, 
so that we need not have to do any work around and decide the sorting pattern 
at the tag level. 


> Date Sorting with Table Decorator
> ---------------------------------
>
>          Key: DISPL-203
>          URL: http://jira.codehaus.org/browse/DISPL-203
>      Project: DisplayTag
>         Type: Bug
>   Components: Decorators
>     Versions: 1.0
>     Reporter: Narayanan A
>  Attachments: Decorator.txt, work-around.txt
>
> Original Estimate: 1 minute
>         Remaining: 1 minute
>
> Hello,
> I have been using display tag with column decorators in my project, recently 
> there was case where we have to use the value in session to decide on the 
> decoration of a column, As column decorator isn't supporting PageContext as 
> of v1.0, i switched to Table decorator,everything works fine except sorting 
> of Date Object Columns. The same column sorting is working fine with "Column 
> Decorator". Date based sorting is very important in the existing 
> functionality and i would request you to kindly help me with this issue. 
> Please find the code snippet attached.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
displaytag-devel mailing list
displaytag-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to