You need to sign in to do that
Don't have an account?
basha sk
how to display standard object records into two sections based on field sepeartion?
Hi Everyone,
I have a custon object called Test__c.I'm trying to display Test__c object records into two sections
in a visualforce based on a field sepeartion.but how to read the fields from cotroller extension.
vf page
-------
<apex:page standardController="Test__c" extensions="DivedeRecordsList" recordSetVar="test" >
<apex:sectionHeader title="Test Records List" />
<apex:form >
<apex:pageBlock Title="Test Records completed">
<apex:pageBlockTable value="{!test}" var="w" >
<apex:column value="{!w.first}" />
<apex:column value="{!w.Second}" />
<apex:column value="{!w.third}" />
<apex:column value="{!w.Expired__c}" />
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock Title="New Test Records">
<apex:pageBlockTable value="{!test}" var="w" >
<apex:column value="{!w.first}" />
<apex:column value="{!w.Second}" />
<apex:column value="{!w.third}" />
<apex:column value="{!w.Expired__c}" />
</apex:pageBlock>
</apex:form>
</apex:page>
Apex class
-----------
public class DivedeRecordsList {
public Test__c testrecords{get;set;}
List<Test__c> lst{get;set;}
List<Test__c> lst1{get;set;}
public DivedeWebinarsList(ApexPages.StandardController controller){
testrecords = (Test__c)controller.getRecord();
}
public List<Test__c> upcomingRecords(){
List<Test__c> lst = [select id,Name,first,second,third from Test__c where Expired__c = 'false'];
return lst;
}
public List<Test__c> completedRecords(){
List<Test__c> lst = [select id,Name,first,second,third from Test__c where Expired__c = 'true'];
return lst;
}
}
Thanks In advance
Sekhar
I have a custon object called Test__c.I'm trying to display Test__c object records into two sections
in a visualforce based on a field sepeartion.but how to read the fields from cotroller extension.
vf page
-------
<apex:page standardController="Test__c" extensions="DivedeRecordsList" recordSetVar="test" >
<apex:sectionHeader title="Test Records List" />
<apex:form >
<apex:pageBlock Title="Test Records completed">
<apex:pageBlockTable value="{!test}" var="w" >
<apex:column value="{!w.first}" />
<apex:column value="{!w.Second}" />
<apex:column value="{!w.third}" />
<apex:column value="{!w.Expired__c}" />
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock Title="New Test Records">
<apex:pageBlockTable value="{!test}" var="w" >
<apex:column value="{!w.first}" />
<apex:column value="{!w.Second}" />
<apex:column value="{!w.third}" />
<apex:column value="{!w.Expired__c}" />
</apex:pageBlock>
</apex:form>
</apex:page>
Apex class
-----------
public class DivedeRecordsList {
public Test__c testrecords{get;set;}
List<Test__c> lst{get;set;}
List<Test__c> lst1{get;set;}
public DivedeWebinarsList(ApexPages.StandardController controller){
testrecords = (Test__c)controller.getRecord();
}
public List<Test__c> upcomingRecords(){
List<Test__c> lst = [select id,Name,first,second,third from Test__c where Expired__c = 'false'];
return lst;
}
public List<Test__c> completedRecords(){
List<Test__c> lst = [select id,Name,first,second,third from Test__c where Expired__c = 'true'];
return lst;
}
}
Thanks In advance
Sekhar
You can make following code changes:
Change APEX method names to following:
1. public List getupcomingRecords()
2. public List getcompletedRecords()
Update your VF page as: Thanks,
Nagendra.
All Answers
You can make following code changes:
Change APEX method names to following:
1. public List getupcomingRecords()
2. public List getcompletedRecords()
Update your VF page as: Thanks,
Nagendra.