Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<apex:page controller="AccountMultipleSearchWithPagenationCLS" action="{!searchAcc}" >
<script type="text/javascript">
window.onload=function() {
// document.getElementById("{!$Component.thePb.thepbs.accName}").focus();
}
</script>
<apex:form >
<apex:pageBlock id="thePb" title="Account Details To Search">
<apex:pageblockSection id="thepbs">
<apex:inputField value="{!acc.Created_From_Date__c}" />
<apex:inputField value="{!acc.Created_To_Date__c}"/>
<apex:inputField value="{!acc.Name}" required="false" id="accName"/>
<apex:inputfield value="{!acc.accountNumber}"/>
</apex:pageblockSection>
<apex:pageblockButtons location="bottom">
<apex:commandButton value="Search" action="{!searchAcc}" />
</apex:pageblockButtons>
</apex:pageBlock>
<apex:pageBlock title="Account Details" id="noRec" rendered="{! IF( accountList != null && accountList.size ==0 , true, false)}" >
<apex:outputPanel >
<h1>No Records Found </h1>
</apex:outputPanel>
</apex:pageBlock>
<apex:pageBlock title="Account Details" id="details" rendered="{! IF( accountList != null && accountList.size >0, true, false)}" >
<apex:pageBlockTable value="{!accountList}" var="a">
<apex:column headerValue="Account Name">
<apex:outputLink target="_blank" value="/{!a.id}">{!a.Name}</apex:outputLink>
</apex:column>
<!-- If you want facet style you can add like this.
<apex:column >
<apex:facet name="header">Link Name</apex:facet>
<apex:outputLink target="_blank" value="/{!a.id}">{!a.Name}</apex:outputLink>
</apex:column>
-->
<apex:column value="{!a.accountNumber}" headerValue="Account Number"/>
<apex:column value="{!a.Industry}" headerValue="Industry"/>
<apex:column value="{!a.AnnualRevenue}" headerValue="Annual Revenue"/>
<apex:column value="{!a.Phone}" headerValue="Phone"/>
<apex:column value="{!a.website}" headerValue="Web"/>
</apex:pageBlockTable>
<apex:pageblockButtons >
<apex:commandButton value="First Page" rerender="details" action="{!FirstPage}" disabled="{!prev}"/>
<apex:commandButton value="Previous" rerender="details" action="{!previous}" disabled="{!prev}"/>
<apex:commandButton value="Next" rerender="details" action="{!next}" disabled="{!nxt}"/>
<apex:commandButton value="Last Page" rerender="details" action="{!LastPage}" disabled="{!nxt}"/>
</apex:pageblockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.