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
Mathew Andresen 5Mathew Andresen 5 

Missing header

Hi,

I have a apex repeat inside my pageblocktable, and for some reason my header's not showing up inside the repeat.  Any ideas?

Thanks,
 
<apex:page controller="FiscalPivot_Class">
 
    
    <apex:pageblock >
    <apex:pageblocktable value="{!completeRowList}" var="row">
		 <apex:column >
      	  <apex:outputtext >{!row.name}</apex:outputtext>
        </apex:column>
        
        <apex:repeat value="{!row.amountMap}" var="periodYear">
        <apex:column>   
            <apex:facet name="header">{!periodYear}</apex:facet>
            <apex:outputtext value="{0,number,###,###,##0}" ><apex:param value="{!row.amountMap[periodYear]}"/></apex:outputtext> 
            </apex:column>
        </apex:repeat>
        
         <apex:column>
		<apex:facet: name="header">Total</apex:facet:>           
        <apex:outputtext value="{0,number,###,###,##0}" ><apex:param value="{!row.lineTotal}"/></apex:outputtext> 
        </apex:column>
                    
        </apex:pageblocktable>
    </apex:pageblock>
</apex:page>



 
Best Answer chosen by Mathew Andresen 5
Robert_StrunkRobert_Strunk
try setting the headerValue attribute on your apex:column like so:
 
<apex:column headerValue="YOUR COLUMN HEADER" >

</apex:column>

 

All Answers

Pramodh KumarPramodh Kumar
Hi Mattew,

Column is not a child tag for the repeat, i have same scenario like this 

Here is the snippet for your code.
<table>
	<thead>
		<tr>
			<th></th>
			<apex:repeat value="{!row.amountMap}" var="periodYear">
				<th>
						{!periodYear}
				</th>
			</apex:repeat>
			
		</tr>
	</thead>
	<tbody>
		<apex:repeat value="{!completeRowList}" var="row">
			<tr>
				<td>
					<apex:outputtext >{!row.name}</apex:outputtext>
				</td>
				<apex:repeat value="{!row.amountMap}" var="periodYear">
					<td>
						<apex:outputtext value="{0,number,###,###,##0}" ><apex:param value="{!row.amountMap[periodYear]}"/></apex:outputtext>
					</td>
				</apex:repeat>
			</tr>
		</apex:repeat>
	</tbody>
</table>

let me know if you have any issues.


Thanks,
pRAMODH.
 
Mathew Andresen 5Mathew Andresen 5
Yes, but it is a child tag of the pageblocktable.  Or does it have to be a direct child?

 
Mathew Andresen 5Mathew Andresen 5
hmm, I don't think that's it.  For example, when I replace 
<apex:repeat value="{!row.amountMap}" var="periodYear">

with 
<apex:repeat value="{!row.amountMap}" var="periodYear">

basically replacing looping through a map with looping through a list, the header works.
Robert_StrunkRobert_Strunk
try setting the headerValue attribute on your apex:column like so:
 
<apex:column headerValue="YOUR COLUMN HEADER" >

</apex:column>

 
This was selected as the best answer
Mathew Andresen 5Mathew Andresen 5
That did it, thanks so much