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
Thorsten HeinrichThorsten Heinrich 

Unable to show column header

below is visualforce page:

<apex:pageBlock title="Open Activity" >
<apex:pageBlockTable value="{!ActivityList}" var="a">
<apex:repeat value="{!a.OpenActivities }" var="b">
<apex:column value="{!b.ActivityDate}"/>
<apex:column value="{!b.Description }"/>
</aepx:repeat>
</apex:pageBlockTable> </apex:pageBlock>
Mahesh DMahesh D
Hi Thorsten

Please use the below code with proper example in it:
 
<apex:page standardController="Account">
    <apex:form >
        <apex:pageBlock title="List of Contacts" tabStyle="Parent__c">
            <apex:pageBlockTable value="{!Account.Contacts}" var="con">
                <apex:column value="{!con.Name}"/>
                <apex:column value="{!con.Title}"/>
                <apex:column value="{!con.Email}"/>
                <apex:column value="{!con.Phone}"/>
            </apex:pageBlockTable>
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="New Contact"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
        <br/>
        <br/>
        <apex:dataTable value="{!Account.Contacts}" var="con" border="1" cellpadding="5" cellspacing="4" bgcolor="lightblue">
            <apex:column value="{!con.Name}">
                <apex:facet name="header">Name</apex:facet>
            </apex:column>
            <apex:column value="{!con.Title}">
                <apex:facet name="header">Title</apex:facet>
            </apex:column>
            <apex:column value="{!con.Email}">
                <apex:facet name="header">Email</apex:facet>
            </apex:column>
            <apex:column value="{!con.Phone}">
                <apex:facet name="header">Phone</apex:facet>
            </apex:column>
        </apex:dataTable>
        <br/>
        <br/>
        <apex:repeat value="{!Account.Contacts}" var="con">
            <apex:outputLabel >{!con.Name}</apex:outputLabel> &nbsp;&nbsp;
            <apex:outputLabel >{!con.Title}</apex:outputLabel> &nbsp;&nbsp;
            <apex:outputLabel >{!con.Email}</apex:outputLabel> &nbsp;&nbsp;
            <apex:outputLabel >{!con.Phone}</apex:outputLabel> <br/>
        </apex:repeat>
    </apex:form>
</apex:page>
Ur Code:
 
<apex:pageBlock title="Open Activity" >
	<apex:pageBlockTable value="{!ActivityList}" var="a">
		<apex:repeat value="{!a.OpenActivities }" var="b">
			<apex:column value="{!b.ActivityDate}">
                <apex:facet name="header">Activity Date</apex:facet>
            </apex:column>
			<apex:column value="{!b.Description}">
                <apex:facet name="header">Description</apex:facet>
            </apex:column>
		</aepx:repeat>
	</apex:pageBlockTable>
</apex:pageBlock>

Please do let me know if it helps you.

Regards,
Mahesh

 
Thorsten HeinrichThorsten Heinrich
Thanks mahesh! I have tried the same but still showing blank column headers. :(
 
Mahesh DMahesh D
Hi Thorsten,

Try any of these ways:
 
<apex:pageBlock title="Open Activity" >
	<apex:pageBlockTable value="{!ActivityList}" var="a">
		<apex:dataTable value="{!a.OpenActivities }" var="b">
			<apex:column value="{!b.ActivityDate}">
                <apex:facet name="header">Activity Date</apex:facet>
            </apex:column>
			<apex:column value="{!b.Description}">
                <apex:facet name="header">Description</apex:facet>
            </apex:column>
		</aepx:dataTable>
	</apex:pageBlockTable>
</apex:pageBlock>
 
<apex:pageBlock title="Open Activity" >
	<apex:pageBlockTable value="{!ActivityList}" var="a">
		<apex:pageBlockTable value="{!a.OpenActivities }" var="b">
			<apex:column value="{!b.ActivityDate}"/>
			<apex:column value="{!b.Description}"/>
		</aepx:pageBlockTable>
	</apex:pageBlockTable>
</apex:pageBlock>

Please do let me know if it helps you.

Regards,
Mahesh