Tags » Pagination

I got a job!

After ten weeks of being in Texas, and applying to over 75 jobs, I finally was hired, and not a moment too soon either.

I am a paginator for Houston Community Newspapers. 203 more words


Organising the Writer's Notebook: the Index (or Table of Contents)

I love writing longhand. There’s something deeply satisfying about filling up a blank page with words. Stuffing a notebook to the brim is better than chocolate, and I have dozens of the things, fat with ink, lining shelves and stacked in corners throughout my home. 454 more words


How To Add Pagination To Your WordPress Theme with custom query

Simply add the following code at the end of your functions.php file (or whatever file in your theme where you want to keep it).

// Numbered Pagination…
228 more words


SEO and technical issues we encountered in Drupal 7

Since I joined City A.M., we’ve been gradually migrating away from Drupal 7 to a fully bespoke CMS built on Laravel. We had planned to do this anyway, but we accelerated parts of the migration as we hit issues that we were unable to solve. 1,104 more words


Pagination to inflate analytics

Why it’s done and why it doesn’t work

How annoying is it when you see an interesting article online such as 18 popular breakfast foods you must avoid… 382 more words

Visualforce Standard Set Controller & Pagination

Standard Set Controller & Pagination

<apex:page controller="Pagination">
    <apex:form >
    <apex:sectionHeader title="Account" subtitle="Account List View"/>    
        <apex:pageBlock id="pb" mode="edit">
            <apex:pageBlockSection title="Account Pagination Demo" columns="1">
            <apex:pageBlockTable value="{!Accounts}" var="a">
                <apex:column value="{!a.Name}"/>
                <apex:column value="{!a.Type}"/>
                <apex:column value="{!a.BillingCity}"/>
                <apex:column value="{!a.BillingState}"/>
                <apex:column value="{!a.BillingCountry}"/>
            <apex:panelGrid columns="7">
                <apex:commandButton status="fetchStatus" reRender="pb" value="<< First" action="{!first}" disabled="{!!hasPrevious}" title="First Page"/>
                <apex:commandButton status="fetchStatus" reRender="pb" value="< Previous" action="{!previous}" disabled="{!!hasPrevious}" title="Previous Page"/>
                <apex:commandButton status="fetchStatus" reRender="pb" value="Next >" action="{!next}" disabled="{!!hasNext}" title="Next Page"/>
                <apex:commandButton status="fetchStatus" reRender="pb" value="Last >>" action="{!last}" disabled="{!!hasNext}" title="Last Page"/>
                <apex:outputText >{!(pageNumber * size)+1-size}-{!IF((pageNumber * size)>noOfRecords, noOfRecords,(pageNumber * size))} of {!noOfRecords}</apex:outputText>
                <apex:commandButton status="fetchStatus" reRender="pb" value="Refresh" action="{!refresh}" title="Refresh Page"/>
                <apex:outputPanel style="color:#4AA02C;font-weight:bold">
                    <apex:actionStatus id="fetchStatus" startText="Fetching..." stopText=""/>

public with sharing class Pagination {
    Public Integer noOfRecords{get; set;}
    Public Integer size{get;set;}
    public ApexPages.StandardSetController setCon {
            if(setCon == null){
                size = 5;
                string queryString = 'Select Name, Type, BillingCity, BillingState, BillingCountry from Account order by Name';
                setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
                noOfRecords = setCon.getResultSize();
            return setCon;
    Public List<Account> getAccounts(){
        List<Account> accList = new List<Account>();
        for(Account a : (List<Account>)setCon.getRecords())
        return accList;
    public pageReference refresh() {
        setCon = null;
        return null;
    public Boolean hasNext {
        get {
            return setCon.getHasNext();
    public Boolean hasPrevious {
        get {
            return setCon.getHasPrevious();
    public Integer pageNumber {
        get {
            return setCon.getPageNumber();
    public void first() {
    public void last() {
    public void previous() {
    public void next() {