我想列出来自表的调查结果,但出现错误
Unknown property 'PencilListController.Pencil_Box__c'
我需要在VisualForce页面上显示结果。
VF页面
<apex:page controller="PencilListController">
<apex:form>
<apex:pageBlock title="Pencil List" id="Pencil_Box_list">
<apex:pageBlockTable value="{!Pencil_Box__c}" var="pb">
<apex:column value="{!pb.Name}"/>
<apex:column value="{!pb.CreatedBy}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
顶点控制器
public class PencilListController {
public class PencilBoxListController {
private String sortOrder = 'CreatedBy';
public List<Pencil_Box__c>getPencil(){
List<Pencil_Box__c> results = Database.query(
'SELECT Id, Name,CreatedBy FROM Pencil_Box__c');
return results;
}
}
}