You need to sign in to do that
Don't have an account?
Gaurav Idnani
page block table not displaying any records for controller extension variable
<apex:pageBlockSection collapsible="true">
<apex:pageBlockTable title="Leave record" value="{!lrs}" var="lr">
<apex:column >
<Apex:outputText value="{!lr.from_date__c}" />
</Apex:column>
</apex:pageBlockTable>
</apex:pageBlockSection>
Controller extension for the code:
public with sharing class LeaveControllerExtension {
public List<Leave_Request__c> lrs { get; set; }
public LeaveControllerExtension(ApexPages.StandardController controller) {
Leave_Request__c lr = (Leave_Request__c)controller.getRecord();
lr.from_date__c = Date.Today();
lr.to_date__c = Date.Today() + 1;
String cui = UserInfo.getUserId() ;
List<Leave_Request__c> lrs = [SELECT From_date__c , To_date__c , Approver__c
FROM Leave_request__c
WHERE Resource__c = :cui] ;
}
}
<apex:pageBlockTable title="Leave record" value="{!lrs}" var="lr">
<apex:column >
<Apex:outputText value="{!lr.from_date__c}" />
</Apex:column>
</apex:pageBlockTable>
</apex:pageBlockSection>
Controller extension for the code:
public with sharing class LeaveControllerExtension {
public List<Leave_Request__c> lrs { get; set; }
public LeaveControllerExtension(ApexPages.StandardController controller) {
Leave_Request__c lr = (Leave_Request__c)controller.getRecord();
lr.from_date__c = Date.Today();
lr.to_date__c = Date.Today() + 1;
String cui = UserInfo.getUserId() ;
List<Leave_Request__c> lrs = [SELECT From_date__c , To_date__c , Approver__c
FROM Leave_request__c
WHERE Resource__c = :cui] ;
}
}
In your code, you are not assigning to values for the Irs list. Change the code as below,
regards
All Answers
In your code, you are not assigning to values for the Irs list. Change the code as below,
regards