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
BenzyBenzy 

Using 'rendered' in apex column stops 'headerValue' being displayed

I have a pageBlockTable with a number of columns.

If I use 'rendered' in a column, then the headerValue no longer displays. Eg:

<apex:column headerValue="Program" value="{!program.Program_Public_Name__c}"/> THIS SHOWS THE HEADER LABEL

<apex:column headerValue="Program" value="{!program.Program_Public_Name__c}" rendered="{!IF(program.Program_Status__c == 'Applications Open', true, false)}"/> NO HEADER LABEL FOR THIS

Any idea why?
Thanks
Best Answer chosen by Benzy
Ashish_Sharma_DEVSFDCAshish_Sharma_DEVSFDC
Hi Benzy,

Try Below Code.

<apex:column headerValue="Program"> 
    <apex:outputText value="{!program.Program_Public_Name__c}" rendered="{!IF(program.Program_Status__c == 'Applications Open', true, false)}">
     </apex:outputText>
</apex:column>

Please Mark this as BEST ANSWER if it solves your issue.

All Answers

shiva pendemshiva pendem
HI Benzy,


<apex:column headerValue="Program" value="{!program.Program_Public_Name__c}" rendered="{!IF(program.Program_Status__c == 'Applications Open', true, false)}"/> 
in this column using 'rendered' attribute so whenever  program_Status__c='Applications Open' then only the column will be display on the page.else entire column will be in hidden .So if you want header value separatly then you can take another html table for headers on top of pageBlockTable and remove the header values in column .
 
Ex: <table>
      <th> program </th>
     </table>
     <apex:pageblacktable>
     <apex:column headerValue="Program" value="{!program.Program_Public_Name__c}" rendered="{!IF(program.Program_Status__c ==       'Applications Open', true, false)}"/>
    </apex:pageblacktable>


Thanks ,
Shiva.
Ashish_Sharma_DEVSFDCAshish_Sharma_DEVSFDC
Hi Benzy,

Try Below Code.

<apex:column headerValue="Program"> 
    <apex:outputText value="{!program.Program_Public_Name__c}" rendered="{!IF(program.Program_Status__c == 'Applications Open', true, false)}">
     </apex:outputText>
</apex:column>

Please Mark this as BEST ANSWER if it solves your issue.
This was selected as the best answer