I have the below implementation:
Class:
public class myClass{
public Boolean conSize {get;set;}
public void searchCon(){
//Some code
if(conList.size()>0){
//Some code
conSize = true;
} else {
conSize = false;
}
}
}
VF page:
<apex:outputPanel rendered="{!conSize}" >
//Display contacts
</apex:outputPanel />
<apex:outputPanel rendered="{! !conSize}" >
//Display 'No contacts retrived'
</apex:outputPanel />
But every time the page loads, I get my error message (which supposed to display only after verifying if the contacts size is != 0) even before my button click for querying the Contacts. What I am missing here?