Skip to main content
Jeffrey Cheung a posé une question dans #Collaboration

<apex:dataTable value="{!Contacts}">

<apex:column >

<apex:outputText>{!c.number.name}</apex:outputText>

</apex:column>

</apex:dataTable>

 

For example, hide the number column if all contacts has no number.

 

 
6 réponses
  1. 9 nov. 2017, 04:35
    Hi Jeffrey,

     

    You can use the rendered property.Something like below:

     

    <apex:dataTable value="{!Contact}" var="con">

     

                <apex:column rendered="{!con.firstname<>""}">

     

                    <apex:outputText>{!con.name}</apex:outputText>

     

                </apex:column>

     

    </apex:dataTable>

     

    It would only render the column if contact has a first name.

     

    Please mark it the best answer if it solves the issue.

     

    Best,

     

    Savina