Skip to Content
Author's profile photo Mikhail Shipulin

Table Sorter – Java class used for table sorting (Web Dynpro Java) bug

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):

1.JPG

fig.1 Comparator map creation

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

2.JPG

fig.2 Table sorter object instantiation


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

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.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.