Displaying related contacts

Visualforce page:

<apex:page standardController="account" extensions="ipf">
<apex:form id="f1">
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputField value="{!account.name}"/><br/>
<apex:commandButton value="Find" action="{!find}" reRender="out" status="mystatus"/>
</apex:pageBlockSection>
<apex:pageBlockSection id="pb">
<apex:actionStatus id="mystatus" startText="Loading......">
<apex:facet name="stop">
<apex:outputPanel id="out">
<apex:pageBlockTable value="{!conts}" var="c" id="tbl" >
<apex:column headerValue="Name" value="{!c.name}"/>
<apex:column headerValue="phone" value="{!c.phone}"/>
</apex:pageBlockTable><br/>
<apex:outputText rendered="{!(conts.size=0)}" value="No Records Found"/>
</apex:outputPanel>
</apex:facet>
</apex:actionStatus>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Apex class:

public with sharing class ipf
{
ApexPages.StandardController con;
account ee;
List<Account> lstaccount = new List<Account>();
List<contact> lstcontacts = new List<contact>();
public ipf(ApexPages.StandardController controller)
{
// employee__c ee=(employee__c)controller.getRecord();
con=controller;
}
public List<contact> getconts()
{
ee=(account)con.getRecord();
lstcontacts.clear();
accIds.clear();
lstaccount.clear();
if(ee.name<>null)
{
lstaccount=[select id,name from Account where name=:ee.Name];
}
for(Integer i=0;i<lstaccount.size();i++)
{
accIds.add(lstaccount[i].Id);
}
lstcontacts =[select id,name,phone,accountId from contact where accountid in : accIds];
return lstcontacts;
}
set<string> accIds = new set<string>();
public pagereference find()
{
return null;
}
}

 

See the below vfpage output:

Contacts