+ Start a Discussion
Michele Kleinhomer 10Michele Kleinhomer 10 

suppress blank PageBlockTable rows

For some reason I am getting blank rows in a PageBlockTable when I am rendering the contents for certain records hidden.  The data is hidden, but the blank rows still appear.  Any thoughts?  Thank you!
<apex:page controller="DisplayGC" action="{!load}" sidebar="false">  
  <apex:sectionHeader  />

  <apex:repeat value="{!tiers}" var="tier">

    <apex:pageBlock title="{!tier}" >
<apex:pageBlockSection columns="1" title="{!tier}">
    <apex:pageBlockTable value="{!contacts}" var="contact">
          <apex:column> 
    <apex:outputText value="{!contact.Name}" 
                      rendered="{!IF(tier == contact.Tier_Level__c, true, false)}">
     </apex:outputText>
</apex:column>
    </apex:pageBlockTable>
</apex:pageBlockSection>
    </apex:pageBlock>
  </apex:repeat>
</apex:page>
Michele Kleinhomer 10Michele Kleinhomer 10
I resolved my problem by moving my rendering logic to the column level.
<apex:page showHeader="false" action="{!load}" standardStylesheets="true" standardController="contact" extensions="DisplayGC" sidebar="false" docType="html-5.0" applyBodyTag="False" applyHtmlTag="False">
<style type="text/css">
        body {
    background-color: white;
}
        .pbTitle {
        white-space:nowrap;
        border:white;
    }
    </style>
    <apex:repeat value="{!tiers}" var="tier">
    <apex:pageBlock title="{!tier}" >
<apex:pageBlockSection columns="1" >
    <apex:pageBlockTable value="{!contacts}" var="contact">
          <apex:column rendered="{!IF(tier == contact.Tier_Level__c, true, false)}"> 
    <apex:outputText value="{!contact.Name}" rendered="{!IF(tier == contact.Tier_Level__c, true, false)}">
     </apex:outputText>
</apex:column>
    </apex:pageBlockTable>
</apex:pageBlockSection>
    </apex:pageBlock>
  </apex:repeat>
</apex:page>