+ Start a Discussion
Eli Flores, SFDC DevEli Flores, SFDC Dev 

How to hide a column in PageTableBlock

 

 

 I'm  having an issue with trying to hide column. I can't seem to make it so the header doesn't render.

 

stuff like this is  working fine:

 

 <apex:column headerValue="{!$ObjectType.Inventory__c.fields.Root_Cause__c.label}" rendered="{!$UserRole.Name != 'Plexus Partner User'}">
  <apex:outputText value="{!rmaInv.Inventory__r.Root_Cause__c}"/>
</apex:column>

 

 

 

But if i try a modestly more complex switch

 

It simple doesn't render the content but keeps the header entry intact so all the remaining cells are shifted to the left:

<apex:column rendered="{!AND($UserRole.Name != 'Partner User', rmaInv.Inventory__r.Confirmed_Diagnosis__c!='Completed by Partner')}">
  <apex:facet name="header">{! IF(AND($UserRole.Name != 'Partner User', rmaInv.Inventory__r.Confirmed_Diagnosis__c!='Completed by Partner'),'noheader',$ObjectType.Inventory__c.fields.Echo_Remote__c.label)}</apex:facet>
  {!AND($UserRole.Name != 'Partner User', rmaInv.Inventory__r.Confirmed_Diagnosis__c!='Completed by Partner')}<br />
  {!rmaInv.Inventory__r.Echo_Remote__c}<br/>
  {!IF(AND($UserRole.Name != 'Partner User', rmaInv.Inventory__r.Confirmed_Diagnosis__c!='Completed by Partner'),$ObjectType.Inventory__c.fields.Echo_Remote__c.label,'')}<br />
  {!$UserRole.Name != 'Partner User' && rmaInv.Inventory__r.Confirmed_Diagnosis__c!='Completed by Partner'} 
</apex:column>

 

 

The other weird thing is that no matter what I do, the expression in the <apex:facet> always seems to evaluate to true though in the next line where it's rendered into the sell, it correctly evaluates to the false.

 

Anyone have any ideas?