Skip to main content
Hi,

I wanted to add some additional rows to my pageblock table.  For example, I'm doing a top 10 opportunities, and I wanted

total opportuntities

total goal 

variance from goal.

Is this possible?   I figure I could make a custom class and piece together all the different pieces but I'm hoping there's a better easier solution, kind of like how you might do it when piecing together a regular table with apex repeat.

Thanks,
2 answers
  1. Oct 14, 2015, 6:29 PM
    Hi Mathew,

    Try  this -

    <apex:commandButton value="Add Row" action="{!addrow}" />

    Controller-

             public class demo {

             public list<Opportunitie > accon{get;set;}

             public Opportunitie agnt{get;set;}   

         public demo(apexpages.standardcontroller controller )

       {

                 agnt = new Opportunitie ();

                 accon= [select id,Name,total_opportuntities__c,total_goal__c,variance_from_goal__c from Opportunitie ]; 

      }

     public void addrow() {        

           Opportunitie opp = new Opportunitie();

            opp.total_opportuntities__c= agnt.total_opportuntities__c;

            opp.total_goal__c= agnt.total_goal__c;

            opp.variance_from_goal__c =agnt.variance_from_goal__c ;

            accon.add(opp );

            //insert prodiscount;

            

            }  

    }

     
0/9000