
////My Component///////
<apex:component selfClosing="true" layout="block" >
<apex:attribute type="SObject[]" description="List of records that needs to be displayed in the table" name="sObjList" required="true"/>
<apex:attribute type="String[]" description="List of field api name to be displayed as column" name="fieldList" required="true"/>
<!--Inculding the required jQuery Files--->
<apex:includeScript value="{!URLFOR($Resource.jQuery_BlogForce9_162, 'js/jquery-1.6.2.min.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.jqQueryTableSorter, 'jquery.tablesorter.min.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.jqQueryTableSorter, 'jquery.tablesorter.pager.js')}"/>
<script>
$j = jQuery.noConflict();
$j(document).ready(function()
{
//enable sorting in pageblock tables using table sorter plugin
$j(".BlogForce9Table").tablesorter().tablesorterPager({container: $j("#.pager")});
$j(".BlogForce9Table").bind("sortEnd",function(e) {
$j('.mySort').remove();
$j('.headerSortDown').children().append('<apex:image value="/s.gif" styleClass="sortDesc mySort" alt="Sorted Descending" title="Sorted Descending" /> ');
$j('.headerSortUp').children().append('<apex:image value="/s.gif" styleClass="sortAsc mySort" alt="Sorted Ascending" title="Sorted Ascending" />');
});
}
);
</script>
<apex:pageBlockSection columns="1">
<apex:pageBlockTable value="{!sObjList}" var="obj" id="myTableBlogForce9" styleClass="BlogForce9Table">
<apex:column headerValue="select">
<apex:inputCheckbox />
</apex:column>
Search By Activity Name<apex:inputText />
<apex:repeat value="{!fieldList}" var="f">
<apex:column value="{!obj[f]}"/>
</apex:repeat>
<apex:facet name="footer">
</apex:facet>
</apex:pageBlockTable>
<div class="paginator" id="pager">
<span class="prevNextLinks">
<span class="prevNext">
<img src="/s.gif" class="first" style="cursor:pointer"/>
</span>
<span class="prevNext">
<img src="/s.gif" class="prev" style="cursor:pointer"/>Previous
</span>
<span class="prevNext">
Next<img src="/s.gif" class="next" style="cursor:pointer"/>
</span>
<span class="prevNext">
<img src="/s.gif" class="last" style="cursor:pointer"/>
</span>
</span>
<select class="pagesize">
<option selected="selected" value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">35</option>
</select>
</div>
</apex:pageBlockSection>
</apex:component>
//////And Here is My Vf Page//////
<apex:page controller="pagination" showHeader="true" sidebar="false">
<apex:form >
<apex:pageBlock title="Sample Pagination ">
<c:Enhancedpageblock sObjList="{!ActivityMaster}" fieldList="{!fields}"/>
<apex:outputPanel >
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
</apex:page>
Hey Mohan,
You're gonna need some SOQL to do this
String searchTerm = '%' + input + '%';
List<Account> accounts = [SELECT Id, Name FROM Account WHERE Name LIKE :searchTerm];
The % are just wildcards in the search!
David