Tapestry5 jQuery provides jQuery Components and can fully replace Prototype and Scriptaculous by jQuery

Tapestry5 JQuery

In this sample, we will create a DataTable with a Filter mechanism on each columns

For doing that, we will create a mixin using the columnFilter plugin : http://jquery-datatables-column-filter.googlecode.com/svn/trunk/index.html

This mixin will have one JSON-type parameter, corresponding to the parameter of the JavaScript plugin.

The mixin will call 2 JavaScript functions :

  • By default, the Tapestry5-jQuery datatable have only on TR element in its THEAD. In order to make the columnFilter working, we have to add a second one. This clone will be done before the creation of the dataTable, by using the InitializationPriority.EARLY priority.
  • We will call the columnFilter plugin after creating the DataTable, with the InitializationPriority.LATE priority.

If you use the DataTable in an Ajax mode, you should create your implementation of the DataTableModel interface, in order to consider all the filters. For more information, please have a look to this sample.

DataTable Sample
Last Name First Name Occupation Date Of Birth
Spearce Britney SINGER Wed Dec 02 00:00:00 CET 1981
Clinton Bill POLITICIAN Mon Aug 19 00:00:00 CET 1946
Domingo Placido SINGER Tue Jan 21 00:00:00 CEST 1941
Einstein Albert SCIENTIST Fri Mar 14 00:00:00 CET 1879
Hemingway Ernest WRITER Fri Jul 21 00:00:00 CET 1899
Pavarotti Luciano SINGER Sat Oct 12 00:00:00 CET 1935
Reagan Ronald POLITICIAN Mon Feb 06 00:00:00 CET 1911
Picasso Pablo ARTIST Tue Oct 25 00:00:00 CET 1881
Pascal Blaise SCIENTIST Mon Jun 19 00:00:00 CET 1623
Newton Isaac SCIENTIST Sun Jan 04 00:00:00 CET 1643
Vivaldi Antonio COMPOSER Fri Mar 04 00:00:00 CET 1678
Paganini Niccolo MUSICIAN Sun Oct 27 00:00:00 CET 1782
Kepler Johannes SCIENTIST Thu Dec 27 00:00:00 CET 1571
Kafka Franz WRITER Tue Jul 03 00:00:00 CET 1883
Gershwin George COMPOSER Mon Sep 26 00:00:00 CET 1898
Last Name First Name Occupation Date Of Birth