0

I am having an issue wherein the apex:facet header for my apex data table is not showing up in the result. I am fairly certain this is due to be adding a filter for the record type in the column. However, since I need both functionality, is there any workaround for this to have the header re-appear?

         <apex:dataTable value="{!relatedTo.Cases__r}" var="c" id="caseTable" rowClasses="odd,even" styleClass="tableClass" border="solid" cellpadding="5px">
            <apex:column rendered="{!if(claim.recordTypeID == '01224000000EpzRAAS','true','false')}">
                <apex:facet name="header">Case Number</apex:facet>
                <apex:outputText value="{!c.CaseNumber}"/>
            </apex:column>
            <apex:column rendered="{!if(claim.recordTypeID == '01224000000EpzRAAS','true','false')}">
                <apex:facet name="header">Case Type</apex:facet>
                <apex:outputText value="{!c.Type}"/>
            </apex:column>
            <apex:column rendered="{!if(claim.recordTypeID == '01224000000EpzRAAS','true','false')}">
                <apex:facet name="header">Follow up Date</apex:facet>
                <apex:outputText value="{0,Date,dd/MM/yy}"><apex:param value="{!c.Follow_up__c}" /></apex:outputText>
            </apex:column>
        </apex:dataTable>
  • What is claim? You define a var c, but there's no claim here. – sfdcfox Jun 23 at 12:45
0

If you want the header to appear but not the value, you can place the filter at the apex:outputText instead:

<apex:column>
    <apex:facet name="header">Case Number</apex:facet>
    <apex:outputText value="{!c.CaseNumber}" rendered="{!claim.recordTypeID == '01224000000EpzRAAS'}"/>
</apex:column>

Tip: rendered attribute expects a Boolean value, conditional logic returns a Boolean, hence no IF function is needed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.