• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TotalWrapper for displaytag

 
Grishma Dube
Ranch Hand
Posts: 275
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using displaytag to display a table on the page. I have got a JSP which displays statistics table. At the end of the table, it shows total of each column.

To achieve this, i need to write a TotalWrapper using TableDecorator. Has anyone done this before? If yes, can anyone send me a sample?

TIA

Grishma
 
Rajan Janakra
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
In your jsp refer the decorator has shown below , <display:table decorator="com.sp.test.displaytag.TotalWrapper"
</display:table>
To write a decorator follow this steps,
1.import org.displaytag.decorator.TableDecorator;
2.Extend TableDecorator class
3.
Give additional decoration or calculation with the getter method for the corresponding property name
//For Example
public String getNdccnt()
{
VO object = (VO) getCurrentRowObject();
int index = getListIndex();
int viewIndex=getViewIndex();
//your stuff object.methodname returns other bean properties.
return //decorated stuff;
}
Hope this would be helpfull
 
Grishma Dube
Ranch Hand
Posts: 275
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx..

I tried writting one wrapper...but facing some issues...

cud you pls elaborate?
 
Rajan Janakra
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give me some detail on your issues?.
-Rajan.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic