[SalesForce] Creating Visualforce pageBlockTable with Custom Object / Table not Appearing

I'm having an issue where my visual force page is not showing any data. The SOQL query tool clearly shows data entered in the database, but the visual force table is not populated.

Here is my controller

public class retrieveDivision {
    public ApexPages.StandardSetController setCon {
        get {
            if(setCon == null) {
                setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
                    [SELECT Name, Percent_Spent__c FROM Division__c]));
            }
            return setCon;
        }
        set;
    }
    public List<Division__c> getDivisions() {
        return (List<Division__c>) setCon.getRecords();
    }
}

And my visual force page.

<apex:page controller="retrieveDivision">
    <apex:pageBlock rendered="True" title="Divisions"  >
        <apex:pageBlockTable value="{!divisions}" var="div">
            <column hadervalue="Name" value="{!div.Name}"/>
            <column value="{!div.Percent_Spent__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

The resulting table as it appears in my dashboard:

enter image description here

Best Answer

You have written:

<column hadervalue="Name" value="{!div.Name}"/>
<column value="{!div.Percent_Spent__c}"/>

which looks like it doesn't render in the browser (though is valid XML so doesn't cause an error because Visualforce allows you to include non-Visualforce tags) rather than using the required Visualforce apex:column component:

<apex:column headervalue="Name" value="{!div.Name}"/>
<apex:column value="{!div.Percent_Spent__c}"/>
Related Topic