DisplayTag

C# has something that's a strong advantage over the base Java libraries; it has UI widgets.  If you want to show a table of search results to the user in the UI, you can write the code for the table manually, or you can just drop in a GridView and have it do most of the tedious work for you.

Java's added a *lot* of classes to Standard Edition and Enterprise Edition, but I haven't seen anything covering something like "show a table to the user".  http://displaytag.sourceforge.net/1.2/">DisplayTag is an open source project under a very http://displaytag.sourceforge.net/1.2/license.html">liberal license.  It builds and styles tables on screen as a JSP Custom Tag, allows a reasonable amount of extension, and handles things like pagination and sorting for you.  It also seamlessly handles exports to Excel/CSV and XML, and with extra libraries, easily supports PDF, XLS, and RTF formats.

We've extended it seven ways from Sunday at this point, so that our code handles the pagination, special columns can be added with AJAX-y expand/collapse of large fields, and certain columns can easily be hidden or shown.  It was easy to convince it to style exactly like our existing pages, so we were able to drop this in on the backend slowly over time; the users never saw a change, but developers writing new pages spent a lot less time typing, and moved onto the next assignment much more quickly.

At some point in the next few weeks, I'd like to kind of review in my head the "lessons learned", and see if there's anything I can contribute back to the library.  Meanwhile, the wood shop continues to eat up most of my time this month.

1 comment:

book said...

快樂是你與生俱來的權力,它不應該取決於你完成什麼。 ..................................................