This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes TotalWrapper for displaytag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "TotalWrapper for displaytag" Watch "TotalWrapper for displaytag" New topic
Author

TotalWrapper for displaytag

Grishma Dube
Ranch Hand

Joined: Jul 01, 2003
Posts: 275
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

Joined: Jun 21, 2005
Posts: 9
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

Joined: Jul 01, 2003
Posts: 275
Thanx..

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

cud you pls elaborate?
Rajan Janakra
Greenhorn

Joined: Jun 21, 2005
Posts: 9
Can you give me some detail on your issues?.
-Rajan.
 
GeeCON Prague 2014
 
subject: TotalWrapper for displaytag