You need to sign in to do that
Don't have an account?
![Mathew Andresen 5 Mathew Andresen 5](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Adding additional rows to pageblock table
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,
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,
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;
}
}