Skip to Content
Former Member
Apr 07, 2008 at 08:22 PM

Custom Class Comparator, Property Metadata, Sorting of Currency Values


I have setup a custom, predefined KM property that contains a currency value. I want the value to sort as a numeric value, rather than a string.

I have tried to implement a custom Comparator Class, by extending the class ResourcePropertyComparator. This is similar to the SAP class DefaultResourcePropertyComparator.

I then added the fully defined class name to the configuration field for Class Comparator in the Property Metadata. I also tried various other options, including removing the package name, etc.

When a sort is attempted, it appears as if the SAP code cannot find my new class. It throws the following exception:

java.lang.NullPointerException: Could not create a valid Comparator instance for the given metaname serco_transactions:serco_invoice_amount_due

at com.sapportals.wcm.rendering.collection.DefaultResourcePropertyComparator.setComparator(

What am I doing wrong? How can I implement the custom comparator properly?