• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

TotalWrapper for displaytag

 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx..

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

cud you pls elaborate?
 
Rajan Janakra
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you give me some detail on your issues?.
-Rajan.
 
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic