Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<Account> allAccs{get;set;}
- public addRowRemoveRow(){
- allAccs = new List<Account>();
- Account acc1 = new Account();
- allAccs.add(acc1);
- }
- public void addRowMethod(){
- Account acc1 = new Account();
- allAccs.add(acc1);
- }
- public void removeRowMethod(){
- }
- public void saveMethod(){
- insert allAccs;
- clearMethod();
- }
- public void clearMethod(){
- integer finalCount = allAccs.size();
- allAccs.clear();
- for(integer i=0;i<finalCount;i++){
- Account acc1 = new Account();
- allAccs.add(acc1);
- }
- }
- </apex:column>
- <apex:column headerValue="Model">
- <apex:inputtext value="{!Accvariable.Name}"/>
- </apex:column>
- <apex:column headerValue="Version">
- <apex:inputtext value="{!Accvariable.Phone}"/>
- </apex:column>
- <apex:column headerValue="Discount">
- <apex:inputtext value="{!Accvariable.website}"/>
- </apex:column>
- </apex:dataTable>
- <apex:pageBlockButtons location="TOP">
- <apex:commandButton value="addRow" action="{!addRowMethod}" rerender="anyName" />
- <!-- <apex:commandButton value="removeRow" action="{!removeRowMethod}"/>-->
- <apex:commandButton value="save" action="{!saveMethod}"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement