That's doing it the hard way. A number of common JSF extensions allow the display of pageable tables with little or no logic at all. Check out the Tomahawk and RichFaces data scroller tags.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
There is another library TRINIDAD which has a nice table component. tr:table, this provides you an excellent feature of paging in tables which can be really useful in case we have a lot of data needs to get displayed...