I have list which hold records of an object "XYZ". I have an ID of a record of "XYZ" object which should display in list[0]
and remaining records next. I am displaying the records using wrapper class. How would I add the matched record to list of zero?
I am adding the records to wrapper class in following way:
wrapperlist(v,g,xyz);
if (xyz.id==r) {
if (WrapperList.isEmpty()) {
WrapperList.set(0,new VWrappers(v,G,xyz));
}
} else {
WrapperList.add(new VWrappers(v,G,xyz));
}
But this would remove and replace it. The initial list[0] is lost.
I am using standard set controller for pagination:
con = new ApexPages.StandardSetController(Database.query(query));
I am passing the records to a wrapper class and displaying the records on the Visualforce page. I want the replace replace the list[0] so that I can display records of my choice initially.