Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How does everyone else handle table entries and null values?

 
Paul Duer
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
So I have alot of stuff in my apps where I am making a table of records on a JSP page. You know almost like a report or a list and then user can click something and go somewhere else.
What I run into alot is that when you're doing names and address that often you'll have fields which a generally blank for most users, like Second Line Address and such.
So for those I usally have to do 2 logic tags to put a   in the final table, because I use alot of table borders.
Is there an easier way to do it, so that I get nice full looking tables, and just blank spots for the empty fields?
 
David Hibbs
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you can do what you've already figured out--use a logic tag.
Or you can do like I did and write your own extensive custom tag library for handling tables.
Actually, I'm in the process of looking into submitting it to Apache for inclusion in the HTML taglib. If there's anyone here from the Struts committers list that's interested, drop me a line!
 
Sven Bell
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about using a <logic resent> tag, it is null, you can check with <logic:notPresent> and what I do is insert a   if it is not present to keep the tables looking good.
 
Paul Duer
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David, I think we'd all like to see the custom tag library you've made, specially if you're going to submit it!
Or email me at paul.duer@haverstickconsulting.com
 
David Hibbs
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've put a re-packaged version on my personal site at http://www.coruscant.cc/Struts/tables.jar
There are a few things that I know need done--i18n capabilities for one--but I think they're quite useful. Esp the fact that the table row highlighting will take care of itself, as long as you declare the style classes on the table accordingly.
Comments are welcomed, esp from Struts committers...
 
Hung Tang
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to give this a look:
http://edhill.its.uiowa.edu/display/
 
David Hibbs
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Hung Tang:
You might want to give this a look:
http://edhill.its.uiowa.edu/display/

That's pretty cool. Many nice features--esp the paging and export--but there are some capabilities missing that I particularly like.
a) the style classes are set in the code
b) You can't mix these with other table components if parts of your table are static
c) sorting is only done per-page
There's also a bug reported in that you can't put more than one of the tables on a page, but based on what I saw in the examples this is only a problem if you want to use the paging feature.
Nonetheless, it's cool enough that I hooked to their CVS repository on SourceForge. Who knows--I may even end up contributing.
 
Paul Duer
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David,
I agree it's a neat TagLib. I am highly considering using it. It has alot of good built in features. But I think in another 6 months if work continues, it would be mature enough for production use.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic