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
Sony PSPSony PSP 

pagetable hide when there is no record and show when there is record

Hi folks i'm new with salesforce, do you have any idea on how can I hide this page table? meaning, onload, no records found, but after clicking the button search, it will display the pagetable result, my problem is it still displays the columns headers onload meaning still without any idea.

<apex:pageBlock title="Final Records">
    <apex:outputPanel layout="block" styleClass="noRecords" rendered="{!conlist.size == 0}"><i> No Records </i>
                </apex:outputPanel>
                <apex:outputPanel layout="block" styleClass="noRecords" rendered="{!conlist.size == NULL}"><i> No  Record </i>
                </apex:outputPanel>
                <apex:pageblocktable value="{!conlist}" var="con" id="pv">
                    <apex:column headerValue="Account Name>  
                        <apex:outputlink value="https://ap1.salesforce.com/{!conlist.Account.id}">{!conlist.Account.Name}</apex:outputlink>  
                    </apex:column>
                    <apex:column headerValue="Country}" value="{!conlist.Account.BillingCountry}" />
                        <apex:outputlink value="https://ap1.salesforce.com/{!conlist.id}"{!conlist.FirstName}</apex:outputlink>  
                    </apex:column>
                </apex:pageblocktable>
SalesFORCE_enFORCErSalesFORCE_enFORCEr
Move your pageBlockTable inside an outputPanel which will be rendered when !conlist.size>0