You need to sign in to do that
Don't have an account?
Parteek Kumar 5
Urgent: How to use sorting in wrapper list of task
Hi All,
I am using a visualforce page for showing task and lead data using wrapper class. In this page I have to use sorting according to priority and activity date. i am not able to understand how to achieve this.
below is my code...
Please help me guys....
I am using a visualforce page for showing task and lead data using wrapper class. In this page I have to use sorting according to priority and activity date. i am not able to understand how to achieve this.
below is my code...
public class wrapper implements Comparable { public decimal st{get;set;} public task t{get;set;} public string wid{get;set;} public wrapper(decimal s,task td,string wi) { st=s; t=td; wid=wi; } public Integer compareTo(Object compareTo) { wrapper compareToEmp = (wrapper)compareTo; if(t.priority==compareToEmp.t.priority) { return 0;} else if(t.priority>compareToEmp.t.priority) {return 1;} else { if(t.activitydate==compareToEmp.t.activitydate) return 0; if (t.activitydate < compareToEmp.t.activitydate) return 1; } return -1; } }
Please help me guys....
NOTE: This code has not been tested and may contain typographical or logical errors