Skip to main content
Hello!

I have created a pageBlockTable, but my column names disappear when I apply the "rendered" tag.  Is there a way that I can statically set the column names so that my table has headers?

 

<apex:pageBlock title="Underfunded Buyers">

<apex:pageBlockTable value="{!listOfBuyer}" var="by">

<apex:column value="{!by.Name}" rendered="{! by.Funding_Status__c = 'Funds Needed'}"/>

<apex:column value="{!by.Spend_Last_Week__c}" rendered="{! by.Funding_Status__c = 'Funds Needed'}"/>

<apex:column value="{!by.Total_Spend_this_Week__c}" rendered="{! by.Funding_Status__c = 'Funds Needed'}"/>

<apex:column value="{!by.Forecasted_Spend__c}" rendered="{! by.Funding_Status__c = 'Funds Needed'}"/>

<apex:column value="{!by.Current_Balance__c}" rendered="{! by.Funding_Status__c = 'Funds Needed'}"/>

</apex:pageBlockTable>

</apex:pageBlock>

Thanks!

John
2 Antworten
  1. 20. Feb. 2015, 11:53
    You can use <apex:facet> tag inside <apex:column> tag:

     

    <apex:page standardController="Account">

    <apex:pageBlock title="Contacts">

    <apex:pageBlockTable value="{!account.Contacts}" var="contact">

    <apex:column >

    <apex:facet name="header">Name</apex:facet>

    {!contact.Name}

    </apex:column>

    <apex:column >

    <apex:facet name="header">Phone</apex:facet>

    {!contact.Phone}

    </apex:column>

    </apex:pageBlockTable>

    </apex:pageBlock>

    </apex:page>

     
0/9000