I have a list of event locations i'm trying to return to a visual force page:
public class EventDataExt {
private final Event__c e;
public EventDataExt(ApexPages.StandardController stdController) {
this.e = (Event__c)stdController.getRecord();
}
public List <Event_Location__c> getels () {
List <Event_Location__c> els = [select Name, City__c from Event_Location__c where Event__c=:e.Id];
return els;
}
}
What I'm trying to do is append values to the end of each object in the list. So in addition to Name and City__c that are fields from the object, i want to add anotherkey => anothervalue
to the end of each object. Any help is much appreciated.
UPDATE:
i'm getting other data that i need from the disp_list: controller extension is here:
public with sharing class xExtDataExtension {
private final Event__c e;
public xExtDataExtension(ApexPages.StandardController stdController) {
this.e = (Event__c)stdController.getRecord();
}
public list<wrapperclass> disp_list{get;set;}
public list<wrapperclass> theEvent {get;set;}
public class wrapperclass{
public Integer Registered{get;set;}
public Integer Attended{get;set;}
public Integer Buyer{get;set;}
public Integer ANB{get;set;}
public Integer RNA{get;set;}
public String Name{get;set;}
}
public xExtDataExtension() {
disp_list=new List<wrapperclass>();
List<Event_Location__c>els=[select id, Name from Event_Location__c];
for(Event_Location__c el:els){
integer fetchRegistered = [select count() from CampaignMember where Event_Location__c=:el.id AND Event_Location_Time__c !=null];
integer fetchAttended = [select count() from CampaignMember where Event_Location__c=:el.id AND Event_Location_Time__c !=null AND Checkin__c=true];
integer fetchBuyer = [select count() from CampaignMember where Event_Location__c=:el.id AND Event_Location_Time__c !=null AND Checkin__c=true AND Lead.IsConverted=true];
integer fetchANB = 0;
integer fetchRNA = 0;
wrapperclass w=new wrapperclass();
w.Registered=fetchRegistered;
w.Attended=fetchAttended;
w.Buyer=fetchBuyer;
w.ANB=fetchANB;
w.RNA=fetchRNA;
w.Name=el.Name;
disp_list.add(w);
}
}
}
what i can't get, is the main object data, what i assume would be the standard controller that i assign in my vf page standardController="Event__c". when i try to output data from e.whatever it comes up blank. i need to access the main object too. it's odd, because if i switch my vf page to use the extension as the controller, then the Event__c data shows up, but the custom list from disp_list disappears. i'm sure i'm missing something easy and fundamental@#$%^&