Home arrow Java arrow Building a Pagination System with AJAX
JAVA

Building a Pagination System with AJAX


You know how to use AJAX to pull rows from a database, but do you know how to create an AJAX-based system to organize the records neatly into pages? You'll know how to do that by the end of this series! This first article shows you how to build the user interface.

Author Info:
By: Alejandro Gervasio
Rating: 3 stars3 stars3 stars3 stars3 stars / 137
June 05, 2006
TABLE OF CONTENTS:
  1. · Building a Pagination System with AJAX
  2. · Building the dynamic scroll bar
  3. · Defining the scrolling systemís CSS declarations
  4. · Defining the (X)HTML markup and JavaScript functions

print this article
SEARCH DEVARTICLES

Building a Pagination System with AJAX
(Page 1 of 4 )

Introduction

If youíre an enthusiast Web developer who has been working with AJAX for a while, then you probably think of it as a remarkable combination of programmatic methods for making HTTP requests in the background, with no page reloads. The longer you think about the methods in the abstract, apart from the possible implementations for this requesting mechanism, the more ideas youíll get for developing potential applications.

Quite possibly, youíve already used AJAX in several areas of Web development, in order to create auto completion systems, highly responsive chatters, or different desktop-like applications that use silent requests as the driving force for performing specific tasks. Does all this stuff sound familiar to you? I hope so.

Also, it should be noticed that most of these applications use a database as the backend for storing dynamic and static content, and eventually there will be a moment when a bunch of records will need to be pulled directly from one or many tables. So, after all this largesse, the question that comes up now is: is it possible to create an AJAX-based mechanism that not only fetches some rows from a database, but is also capable of paginating them? Well, since the first thing you did (at least here) was read the title of this article, the answer is a loud Yes!

However, let me first put things in the right context: when I talk about an AJAX-driven pagination system, certainly Iím not talking about building the popular page links used for many pages of records. Instead, what I plan to construct here is an application that will use a simple scrollbar as the controlling element for displaying chunks of database records, in accordance with its physical position within a (X)HTML containing structure.

According to the programming logic that I just described, the pagination system (in fact, Iíd rather call it a dynamic scrolling system) will display a predefined number of records, which will be fetched dynamically from a database table, either when scrolling up or down inside the containing area, without the need to include page links.

Indeed, the idea sounds interesting, therefore letís start building the user interface of this AJAX-based scrolling system. Letís go!


blog comments powered by Disqus
JAVA ARTICLES

- Java Too Insecure, Says Microsoft Researcher
- Google Beats Oracle in Java Ruling
- Deploying Multiple Java Applets as One
- Deploying Java Applets
- Understanding Deployment Frameworks
- Database Programming in Java Using JDBC
- Extension Interfaces and SAX
- Entities, Handlers and SAX
- Advanced SAX
- Conversions and Java Print Streams
- Formatters and Java Print Streams
- Java Print Streams
- Wildcards, Arrays, and Generics in Java
- Wildcards and Generic Methods in Java
- Finishing the Project: Java Web Development ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials