On 4/25/06, Apache <[EMAIL PROTECTED]> wrote:
> Hi, I'm using the contrib:Table component with a custom table model but I 
> lost the pagination capabilities. Have you ever used a custom table model 
> with the contrib:Table component? I need to implement the pagination control 
> by myself?

It is quite simple, really, depending upon what database you are
using.  The TableModel interface includes the current page number, the
number of entries to return, the column that is being sorted on, and
the sort order, making it very simple to stucture a query that returns
only the requested rows.  You can also structure a similar query in
Hibernate.

In SQL, you can issue a SELECT with the OFFSET and LIMIT keywords
along with ORDER BY.

In hibernate, you can use a Criteria or DetachedCriteria object to
apply offset, limit, and order by clauses.  If you are using Hibernate
via Spring, this is easily accomplished through
HibernateTemplate.findByCriteria().

You should take a look at TapestryTables.war if you haven't already,
as it covers all of this, I believe.  If not, then I am sure that
"Enjoy Web Development With Tapestry" covers it.  I know that I
learned it somewhere, and those are the sources I tend to use.

--sam

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to