Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos

After applying this document Table Sorter - Java class used for table sorting (Web Dynpro Java) - Web Dynpro Java - SCN Wiki

to create web dynpro table sorter I tried to sort result node with custom comparator map, here is code for comparator map creation (fig.1😞

fig.1 Comparator map creation

After this I created table sorter object (fig. 2)

fig.2 Table sorter object instantiation


And finally in onSort table event handler I invoked table sorter sort method (fig. 3)

fig.3 Table sorter object sort method invocation


But my custom comparator compare method was not invoked, so after some investigation I found this bug in getComparator method of TableSorter reference implementaion:

So in getComparator method we some strange activity

We check internal global map comparatorForColumn in TableSorter class firstly by IWDTableColumn key (and check is passed because TableSorter

constructor fill map with this type of key) and after that we are trying to get value by column.getId() - wich is String.

So because IWDTableColumn doesnt implement hashcode methode in such way that it will return hascode of column.getId() String,  comparator reference on this line is null

so further code act like we didn't provide any custom comparators.

Any comments is welcome, don't know how to report about this bug to reference implementation author.

Labels in this area