I quoi trier le tableau par le champ Numéro de commande: Check Listpourquoi case cochée plus élevée que sans contrôle dans le tableau de Visualforce
J'ai un WrapperClass qui implémente l'interface Comparable:
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;
}
}
interface fonctionne comparables mais tout vérifié cases sont plus élevés que non vérifiés. La question est pourquoi les cases à cocher cochées sont plus élevées que non cochées et comment pourrait-on l'éviter?