Using predefined column lists
This example shows how a predefined set of columns can be applied to a table.
All you have to do is feeding the table with a list of beans/Maps which contains the needed column attributes and
create the needed
<display:column>
tags and use a simple iteration directly in the jsp
In this page we create three different set of colums, implemented as Lists of Maps, directly in the jsp. Obviously, you will probably want to configure them in a db, xml file, or any other source for a real use (Spring xml files could be an easy and flexible solution). No dipendence on displaytag-specific classes is required in your application, since you can simply use a plain Map or implement a custom bean.
Click on a column set below to see it applied to the table.
column set 1column set 2column set 3
| email title | date | money |
|---|---|---|
| kasd-diam@elitr.com | Fri May 20 19:16:12 CEST 2011 | 2356.00 € |
| ipsum-tempor@duo.com | Mon Aug 13 19:16:12 CEST 2012 | 513.00 € |
| vero-labore@voluptua.com | Thu Oct 06 19:16:12 CEST 2011 | 2714.00 € |
| diam-Stet@ipsum.com | Sat Feb 18 19:16:12 CET 2012 | 9778.00 € |
| clita-dolores@vero.com | Sun Aug 07 19:16:12 CEST 2011 | 3852.00 € |
| aliquyam-et@sanctus.com | Thu Sep 29 19:16:12 CEST 2011 | 392.00 € |
| invidunt-kasd@dolor.com | Thu Oct 27 19:16:12 CEST 2011 | 8712.00 € |
| magna-At@et.com | Wed Jul 20 19:16:12 CEST 2011 | 9422.00 € |
| eos-erat@invidunt.com | Sat May 11 19:16:12 CEST 2013 | 5285.00 € |
| amet-amet@duo.com | Thu Nov 15 19:16:12 CET 2012 | 8112.00 € |