As per your original question and my comment:
Your example VF page doesn't show up under the Account page layouts as the recordSetVar attribute indicates it is a "set-oriented standard controller". You can use this to override the List, Accounts Tab, and custom list buttons. Not the New/View/Edit/Delete buttons. You are working with multiple records, not a single record.
Your custom fields will need the __c
suffix when working from Visualforce. This is the API name for the field.
See Building Visualforce Pages Using Standard Controllers - Referencing a Single Record:
<apex:page standardController="Account" sidebar="false">
<apex:pageMessages />
<apex:form>
<apex:pageBlock>
<apex:pageBlockButtons>
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Details">
<apex:pageBlockSectionItem>
<apex:outputLabel value="Jan 2014"/>
<apex:inputField value="{!Account.Jan2014__c}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
I believe the problem is that you are binding to the data, which, when rendered with no results, is not there to reference.
Normally, without a field set you would bind to something in metadata. For instance like this:
<!-- meta describe example
<apex:column ... headerValue="{!$ObjectType.MyObj__c.fields.Field__c.label}"/>
<!-- custom label example
<apex:column ... headerValue="{!$Label.CustomLabelName}"/>
The describe example will simply pick up the label property of the field that you set when you defined it. The custom label example does need to be defined by going to Create > Custom Labels in the setup menu.
Using a fieldset, however, you need something more dynamic. Initially I tried the following:
<apex:pageBlockTable value="{!Account.Contacts}" var="c">
<apex:repeat value="{!$ObjectType.Contact.FieldSets.SetOfFields}" var="field">
<apex:column value="{!c[field]}" headerValue="{!c[field].label}"/>
</apex:repeat>
</apex:pageBlockTable>
In this way, I got no header label with my empty list of contacts.
But if I changed the header value as follows:
<apex:pageBlockTable value="{!Account.Contacts}" var="c">
<apex:repeat value="{!$ObjectType.Contact.FieldSets.SetOfFields}" var="field">
<!-- THE headerValue BELOW IS THE DIFFERENCE ----v -->
<apex:column value="{!c[field]}" headerValue="{!field.label}"/>
</apex:repeat>
</apex:pageBlockTable>
This notation is referencing the metadata directly, and in this instance, with an empty list, I see my header labels.
Best Answer
there is a simple way to do this