You need to sign in to do that
Don't have an account?
apex:pageBlockTable value
Does an apex:pageBlockTable value have to be a data table (ie: data from a table / query)? What I need to do is display a list of records formed in a LIST.
The RecordList is created in my APEX class and I'm trying to display it in the Visualforce Page. However, this gives me an Visualforce error Error: Unknown property 'conAttendanceTaking.RecordList'. I'm assuming its because this is a List and not a data table. How do I make something like this work?
public List<Event> RecordList = new List<Event>();
<apex:pageBlock title="Attendance List"> <apex:pageBlockTable value="{!RecordList}" var="rl" id="ResultsDataTable" styleClass="tableClass list" rowClasses="odd,even"> <apex:column value="{!rl.OwnerId}"/> <apex:column value="{!rl.DurationInMinutes}"/> <apex:column value="{!rl.EndDateTime}"/> <apex:column value="{!rl.WhoId}"/> <apex:column value="{!rl.WhatId}"/> <apex:column value="{!rl.ShowAs}"/> <apex:column value="{!rl.StartDateTime}"/> <apex:column value="{!rl.Subject}"/> <apex:column value="{!rl.Type}"/> <apex:column value="{!rl.Attendance_Status__c}"/> <apex:column value="{!rl.Class_Role__c}"/> </apex:pageBlockTable> </apex:pageBlock>
The idea behind my VF Page is to capture data (multiple records) then once all is captured, write the data (RecordList). Trying to collect all the data without writting it in between each record.
do you have a getRecordList() method in your controller? That error suggests you do not.
I don't as I wasn't sure how to structure it. Is it simply something like:
Public List<Event> getRecordList () {
return RecordList ;
}
Maybe I'm thinking too hard about it given RecordList is already created.
Yeah that's all you need to do. I'm assuming that somewhere in your controller you're actually populating recordList with some events via a query or something.
Without a getter your page has no idea what is exposed to it.