Ajax (1) Apex Class (12) Apex Trigger (2) Community (2) Home Page (1) HTML (4) Integration (3) JS (7) KB (1) Label (1) Licenses (1) Listing (1) Log (1) OOPs (5) Sharing (1) Static Resource (1) Test Class (3) URI (1) Visualforce (10)

Tuesday 17 June 2014

Method for Removing Selected Record from list

public void RemoveThis()
      {
         List<Integer> i=new List<Integer>();
         List<WrapClass> lstTemp=new List<WrapClass>();
         for(Integer j=0;j<lstWrap.size();j++)
             {
              if(lstWrap[j].isCheck==true)
                 {
                  i.add(j);
                 }
             }
              m=new List<Integer>();
             for(Integer k=i.size()-1;k>=0;k--)
             {
               m.add(i[k]);
             }
             
         for(Integer objInt:m)
         {
         lstWrap.remove(objInt);
         }
       }

No comments:

Post a Comment