Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. public List<Account> allAccs{get;set;}
  2.  
  3. public addRowRemoveRow(){
  4. allAccs = new List<Account>();
  5. Account acc1 = new Account();
  6. allAccs.add(acc1);
  7. }
  8. public void addRowMethod(){
  9. Account acc1 = new Account();
  10. allAccs.add(acc1);
  11. }
  12.  
  13. public void removeRowMethod(){
  14.  
  15. }
  16. public void saveMethod(){
  17. insert allAccs;
  18. clearMethod();
  19. }
  20.  
  21.  
  22.  
  23. public void clearMethod(){
  24. integer finalCount = allAccs.size();
  25. allAccs.clear();
  26. for(integer i=0;i<finalCount;i++){
  27. Account acc1 = new Account();
  28. allAccs.add(acc1);
  29.  
  30. }
  31.  
  32. }
  33.  
  34. </apex:column>
  35. <apex:column headerValue="Model">
  36. <apex:inputtext value="{!Accvariable.Name}"/>
  37. </apex:column>
  38. <apex:column headerValue="Version">
  39. <apex:inputtext value="{!Accvariable.Phone}"/>
  40. </apex:column>
  41. <apex:column headerValue="Discount">
  42. <apex:inputtext value="{!Accvariable.website}"/>
  43. </apex:column>
  44. </apex:dataTable>
  45. <apex:pageBlockButtons location="TOP">
  46. <apex:commandButton value="addRow" action="{!addRowMethod}" rerender="anyName" />
  47. <!-- <apex:commandButton value="removeRow" action="{!removeRowMethod}"/>-->
  48.  
  49. <apex:commandButton value="save" action="{!saveMethod}"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement