function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Terry411Terry411 

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.

 

jwetzlerjwetzler

do you have a getRecordList() method in your controller?  That error suggests you do not.

Terry411Terry411

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.

jwetzlerjwetzler

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.

venkatesh kotapativenkatesh kotapati
just want to make sure that you mentioned your custom list controller as conAttendanceTaking