I'm using display tags in my jsp to display a table.Using display tags all i could do is use diffrent background colors for even n odd rows.
But what I need is,depending on a condition i've to change the background color of each row.Is this possible using display tags.If so, pls let me know.
Thanks in advance
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
one thing which i still dont understand is when is this addRowClass method to be called.
As I've gone through the API, it was given that 'call back this method to add a class to a row'.
I've written a Decorator class and overrode addRowClass(). Unlike other methods like startRow() and fishRow() which are called by default by the display tags, this addRowClass() is never called by default.This is what I observed by using sys out's.
If it is to be called explicitly, then please let me know.
Anymore insight into this matter would be greatly appreciated.
Thanks in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've not used this myself. I would have thought the method got called when displaytag was creating the tr element. Are you using the version of DisplayTag that has this method? Check it's actually overriding the method in the superclass. You may have to trace through the source to see what's going on.
Ed!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using displaytag1.1.jar Ed. It has this method.
I'm still trying to know where is it getting called. If by any chance u get any more info in this matter please let me know.
Thanks in advance!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You need to create a TableDecorator for the table and override the addRowClass() or addRowId() method to give the <tr> element a class or id attribute that you can then style using CSS.
Hi All,
I'm using display tags in my jsp to display a table.Using display tags all i could do is use diffrent background colors for even n odd rows.
But what I need is,depending on a condition i've to change the background color of each row.Is this possible using display tags.If so, pls let me know.
Thanks in advance
Thanks for replying Ed!
one thing which i still dont understand is when is this addRowClass method to be called.
As I've gone through the API, it was given that 'call back this method to add a class to a row'.
I've written a Decorator class and overrode addRowClass(). Unlike other methods like startRow() and fishRow() which are called by default by the display tags, this addRowClass() is never called by default.This is what I observed by using sys out's.
If it is to be called explicitly, then please let me know.
Anymore insight into this matter would be greatly appreciated.
Thanks in advance.
I've not used this myself. I would have thought the method got called when displaytag was creating the tr element. Are you using the version of DisplayTag that has this method? Check it's actually overriding the method in the superclass. You may have to trace through the source to see what's going on.
Ed!
I'm using displaytag1.1.jar Ed. It has this method.
I'm still trying to know where is it getting called. If by any chance u get any more info in this matter please let me know.
Thanks in advance!
You need to create a TableDecorator for the table and override the addRowClass() or addRowId() method to give the <tr> element a class or id attribute that you can then style using CSS.
See:
http://displaytag.sourceforge.net/11/displaytag/apidocs/org/displaytag/decorator/TableDecorator.html
and
http://displaytag.sourceforge.net/11/tut_decorators.html
Ed!