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
MMA_FORCEMMA_FORCE 

Render Apex:Column the Header goes away?? Help

Hi my header name goes away when I render the column but the value comes up???

 

<apex:column rendered="{!dd.TermD='9.2'}">
<apex:facet name="header">Subject Area</apex:facet>
<apex:outputText value="{!dd.Subject}"/>
</apex:column>

 

 Thanks

 

Message Edited by MMA_FORCE on 03-19-2010 11:07 AM
SPDSPD

did you try it this way?

 

 

 

<apex:column rendered="{!dd.TermD='9.2'}" headerValue = "Subject Area" >
<apex:outputText value="{!dd.Subject}"/>
</apex:column>
MMA_FORCEMMA_FORCE
That did not work... My values come up but no header???
SteveBowerSteveBower
What does the generated HTML code look like?
BrettBBrettB

Any Answers on this?

Prem_PalPrem_Pal
This problem comes in play when the rendered attribute used in apex:column is based on a condition which uses the var property.

e.g. When I use following code the header disappears,because my rendered attribute refers to var property
 
<apex:pageblockTable value="{!myList}" var="record">                           
	<apex:column rendered="{!IF(record.Id != null,true,false)}">
		<apex:facet name="header">
			My Header
		</apex:facet> 
		Some content
	</apex:column>
</apex:pageblockTable>

However, when I remove the var property from rendered attribute, it works fine.

Like this,
 
<apex:pageblockTable value="{!myList}" var="record">                           
	<apex:column rendered="{!IF(showColumn != null,true,false)}">
		<apex:facet name="header">
			My Header
		</apex:facet> 
		Some content
	</apex:column>
</apex:pageblockTable>

Basically, inidividual rows can be rendered using var property but header cannot be. Hope this helps!

Thanks,
Prem
 
Mike DayMike Day
If you add another statement in your render to check if there is an ID the headers should appear.

rendered="{!OR(dd.TermD='9.2',id=''),true,false}"

This checks to see if there is an ID in the field (which there is not in a header field) and displays the data

Hope this helps?