Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Hide Repeating Values in Table??

Status
Not open for further replies.

drluft

Programmer
May 23, 2004
3
US
I am using the logic:iterate tag to display a table of info. It is sorted by the first 3 columns which may be repeated. I want to hide these values for all but the first occurance of it (basically making a group by kind of thing). How do I do that in the jsp? All I need to be able to do is compare the value to the same column, one row up.

Thanks!
 
You really have two ways of doing it

1) Have your data collection class that creates the attribute you iterate through remove the first row (This would be my preferred solution)

2) Use a jsp variable to track the info, combine it with logic:match or logic:notMatch to handle it

option 1 is by far the easiest, most maintainable and stuts like. Keep your classes in control.
 
I wouldn't recommed doing this in the jsp at all.

I would suggest have your action class putting into the session all the information that you wish to display. I.e if you wish for certain rows to be removed then put these conditions in your code and just let the jsp present the data it is given.

-andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top