This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TotalWrapper for displaytag
 
Similar Threads
Adding css to display tag
how to add a numerator (index) in a displayTag?
struts with displayTag, any alternatives?
displaytag should show only previous and next
display tag export problem