I want to sort a wrapper class list which has a reference to another wrapper in it.I tried implementing Comparable interface for both of class but it is showing error
One or more of the items in this list is not Comparable.
Please suggest me some way to do this.
i want to sort list by name and number.i will use a field sortBy for this purpose.
Class A{
list<WrapperB> listOfB{get;set;}
public A(){
listOfB.sort();
}
class WrapperB {
String name{get;set;}
public WrapperC ref{get;set;}
}
class WrapperC{
String number;
}
}