0
我怎麼通過現場訂單號排序表:Check List爲什麼選中的複選框不是選中高於visualforce表
我有一個WrapperClass它實現接口可比:
public class CheckListWrapper implements Comparable
{
public Boolean isChecked {get; set;}
public String shortDescription {get; set;}
public String fullDescription {get; set;}
public Integer order {get; set;}
public CheckList__c checkList;
public CheckListItem__c checkListItem;
public CheckListWrapper(CheckList__c chList)
{
shortDescription = chList.Short_Description__c;
fullDescription = chList.Full_Description__c;
order = (Integer)chList.Order__c;
isChecked = false;
checkList = chList;
}
public CheckListWrapper(CheckListItem__c chListItem)
{
shortDescription = chListItem.CheckList__r.Short_Description__c;
fullDescription = chListItem.CheckList__r.Full_Description__c;
order = (Integer)chListItem.CheckList__r.Order__c;
isChecked = true;
checkListItem = chListItem;
}
public Integer compareTo(Object compareTo)
{
CheckListWrapper compareToCheckList = (CheckListWrapper)compareTo;
Integer returnValue = 0;
if (checkList != null)
{
if (checkList.Order__c > compareToCheckList.checkList.Order__c)
{
returnValue = 1;
} else if (checkList.Order__c < compareToCheckList.checkList.Order__c)
{
returnValue = -1;
}
} else if (checkListItem != null)
{
if (checkListItem.CheckList__r.Order__c > compareToCheckList.checkListItem.CheckList__r.Order__c)
{
returnValue = 1;
} else if (checkListItem.CheckList__r.Order__c < compareToCheckList.checkListItem.CheckList__r.Order__c)
{
returnValue = -1;
}
}
return returnValue;
}
}
接口相媲美的作品,但所有選中的複選框高於未檢查。 問題是爲什麼選中的複選框高於未選中狀態,怎麼可能避免它?