You need to sign in to do that
Don't have an account?
Carter85
Help iterating through a wrapper class list and removing items based on criteria.
I have a list encapsulated in a wrapper class and I'm trying to remove items based on user defined criteria, it this case, whether or not it has been checked off on the list. I can't seem to find the correct syntax for processing however, I always and up with an Illegal assignment error.
My current structure is:
Basically I just want to remove any item which hasn't been selected, so if anyone has a suggestion on the easiest way to do that I would appreciate it.
My current structure is:
Integer selectedCount2 = 0; for(integer i = 0; i < tContractList.size(); i++){ if(!tContractList[i].selected){ tContractList = tContractList.remove(i); } if(tContractList[i].selected == true){ selectedCount2++; } }The error i get is: Compilation error: Illegal assignment from CM_RemittanceClass.contractWrapper to LIST<CM_RemittanceClass.contractWrapper>
Basically I just want to remove any item which hasn't been selected, so if anyone has a suggestion on the easiest way to do that I would appreciate it.
All Answers