'How to hide the whole sobject if there is no record in the object in vf page?

my case is to create resume in vf page with renderas pdf. In that candidate__c, carrersummary__c,Certification__c,WorkExperience__c,etc are my custom objects. Candidate__c is parent and other objects are child. what i want is to hide certification object in pdf if there is the candidate has no certification. certification is a list which has cetification name,validity,credential id which is in controller class.

code in controller class. List<Certifications__c> certificationsList = [select id,Name,Credential_ID__c,Certifications_Validity__c from Certifications__c where Candidate__r.id=:cid];

            clist =new list<Certifications__c>();
                for(Certifications__c c:certificationsList){ 
                    date dt = c.Certifications_Validity__c;
                    String s = dt.year() + '/' + dt.month() + '/' + dt.day(); 
                    c.certificateexpiredate__c = s;
                    clist.add(c);                       
                   }

vf page: <apex:variable value="{!clist}" var="cl" > <apex:outputpanel rendered="{!If(cl!= null, true, false)}">

i used like this...bt this wont work properly. Help me out of this. Thanks in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source