You need to sign in to do that
Don't have an account?
EliH
Visualforce page not showing expected results from Controller Extension
I can't figure out why the list of events expected is not showing up on this page.
VF Page:
<apex:page standardController="Business_Plan__c" extensions="BusinessPlanEventsControllerExtension">
<apex:form >
<apex:pageBlock title="Events">
<apex:pageBlockTable value="{!eventList}" var="oe">
<apex:column value="{!oe.OwnerId}"/>
<apex:column value="{!oe.StartDateTime}"/>
<apex:column value="{!oe.EndDateTime}"/>
<apex:column >
<apex:outputField value="{!oe.Subject}" id="Subject" />
<apex:facet name="header">Subject</apex:facet>
</apex:column>
<apex:column value="{!oe.Description}">
<apex:facet name="header">Purpose of Meeting</apex:facet>
</apex:column>
<apex:column value="{!oe.Outcome__c}">
<apex:facet name="header">Desired and Actual Outcome</apex:facet>
</apex:column>
</apex:pageBlockTable>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}" id="saveButton" />
<apex:commandButton value="Cancel" action="{!cancel}" id="cancelButton" />
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller Extension:
public with sharing class BusinessPlanEventsControllerExtension {
public Business_Plan__c bp;
public Business_Plan__c bpInfo;
public List<Event> eventList {get;set;}
public List<Task> taskList;
public BusinessPlanEventsControllerExtension(ApexPages.StandardController Controller) {
bp = (Business_Plan__c)controller.getRecord();
}
public List<Event> getEvents(){
bpInfo = [SELECT Id FROM Business_Plan__c WHERE id =: bp.Id];
eventList = new List<Event>();
eventList = [SELECT Id, OwnerId, Subject, StartDateTime, EndDateTime, Description, Outcome__c, Complete__c
FROM Event WHERE WhatId =: bpInfo.Id ];
System.debug('Event List' + eventList);
return eventList;
}
}
VF Page:
<apex:page standardController="Business_Plan__c" extensions="BusinessPlanEventsControllerExtension">
<apex:form >
<apex:pageBlock title="Events">
<apex:pageBlockTable value="{!eventList}" var="oe">
<apex:column value="{!oe.OwnerId}"/>
<apex:column value="{!oe.StartDateTime}"/>
<apex:column value="{!oe.EndDateTime}"/>
<apex:column >
<apex:outputField value="{!oe.Subject}" id="Subject" />
<apex:facet name="header">Subject</apex:facet>
</apex:column>
<apex:column value="{!oe.Description}">
<apex:facet name="header">Purpose of Meeting</apex:facet>
</apex:column>
<apex:column value="{!oe.Outcome__c}">
<apex:facet name="header">Desired and Actual Outcome</apex:facet>
</apex:column>
</apex:pageBlockTable>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}" id="saveButton" />
<apex:commandButton value="Cancel" action="{!cancel}" id="cancelButton" />
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller Extension:
public with sharing class BusinessPlanEventsControllerExtension {
public Business_Plan__c bp;
public Business_Plan__c bpInfo;
public List<Event> eventList {get;set;}
public List<Task> taskList;
public BusinessPlanEventsControllerExtension(ApexPages.StandardController Controller) {
bp = (Business_Plan__c)controller.getRecord();
}
public List<Event> getEvents(){
bpInfo = [SELECT Id FROM Business_Plan__c WHERE id =: bp.Id];
eventList = new List<Event>();
eventList = [SELECT Id, OwnerId, Subject, StartDateTime, EndDateTime, Description, Outcome__c, Complete__c
FROM Event WHERE WhatId =: bpInfo.Id ];
System.debug('Event List' + eventList);
return eventList;
}
}
replace your controller code with following code
Controller Extension:
if you found this answer helpful then please mark it as best answer so it can help others.
Thanks
Akshay
All Answers
replace your controller code with following code
Controller Extension:
if you found this answer helpful then please mark it as best answer so it can help others.
Thanks
Akshay