|
Here is what I came up with:
MyListObject totObj = (MyListObject)this.getPageContext().findAttribute("thelist");
int listsize = totObj.getData().size(); // Grand totals...
if ((listsize - 1) == getListIndex()) ...
...
My List Object contains both a List and a Map, where the List component provides the detail rows for the table, whereas the Map contains precalculated totals for display (performed in the business layer).
Comparing the list size to the results of the getListIndex() method (as you suggest), I always output the footer data at the last row.
The result is just what I needed... thanks so much for the guidance!
Regards,
--Chris
>>> [EMAIL PROTECTED] 11/10/2005 5:10:30 PM >>> To determine if the last page is being displayed you could check that the last items in the partial and full list are the same, assuming no repititions in your list. -Jorge --- Jorge Barroso <[EMAIL PROTECTED]> wrote: > You can get the original list by doing the following > from your decorator class: > > Object fullList = > this.getPageContext().findAttribute("fullList"); > > where "fullList" is the name of the list configured > in the name attribute of the displaytag table tag, > e.g., > <display:table id="row" name="${fullList}"... > > With the the full list in hand, you can do your > grand > total. > > That's half the answer. You also need a way to > determine whether it's the last page being > displayed. > Otherwise, this grand total row will show in every > page. Go tta think about that one. > > -Jorge > > --- Christopher Becker <[EMAIL PROTECTED]> > wrote: > > > Yes, you have accurately described my goal. > However, > > I do not understand > > how access to the page context will help me > achieve > > it. Could you please > > elaborate? > > > > Regards, > > > > --Chris > > > > >>> [EMAIL PROTECTED] 11/10/2005 2:44:51 PM >>> > > > > So you want the total to appear only in the last > > page, but you want it > > to be total for the entire table, not just last > > paginated page, right? > > However, the decorated object displaytag makes > > available to the > > decorator is the partial list for the current > page. > > It also, though, > > gives it ac cess to the pagecontext, through > > getPageContext(), which you > > can use to get the original full list you fed > > displaytag. I haven't > > tried this, but it should work. > > > > -Jorge > > > > Christopher Becker <[EMAIL PROTECTED]> > wrote: > > I located the TotalWrapper.java class used in the > > first example, and > > tried writing a modified version. I can get the > > total to display on the > > last page of my table, but unfortunately it only > > displays the column > > total for the last page's values (My list is > long, > > and has multiple > > pages). I need a solution that will provide a > total > > at the end of a > > multi-page table. The examples blelow show all > > results on one page. Do > > you know of a solution that t otals a multi-page > > table? > > > > Regards, > > > > Chris > > > > >>> [EMAIL PROTECTED] 11/10/2005 1:33:44 PM >>> > > > > Look at these examples: > > http://displaytag.homeip.net/example-callbacks.jsp > > > http://www.jamesgood.com:8080/displaytag-examples-1.1-SNAPSHOT/example-new-export.jsp > > > > The second one is a little more involved, but it > > includes convenient > > links to the code. You can get the code for the > > first example by > > checking out the displaytag-examples project from > > cvs. > > > > -Jorge > > > > Christopher Becker <C [EMAIL PROTECTED]> > wrote: > > Hi; > > > > I am interested in displaying the totals row only > at > > the end of the > > table (last page) as well. Could you provide an > > example as to how this > > is done? > > Regards, > > > > --Chris > > > > >>> [EMAIL PROTECTED] 10/12/2005 7:28:12 PM >>> > > > > BTW, if you don't have to place your totals row in > > the > > footer, you can just use a table decorator to > > generate > > your totals row as the last line of the table, and > > avoid the inconsistent tfoot browser > implementations > > altogether. > > > > -Jorge > > > > --- Jorge Barroso <[EMAIL PROTECTED]> wrote: > > > > > Just happened to be reading about this at & gt; htmldog > > > today, > > > > > > http://www.htmldog.com/guides/htmladvanced/tables/, > > > where you'll find out that > > > when printed, the thead and tfoot rows SHOULD > > appear > > > on every page. > > > Mozilla is following the standard, whereas > > > "IE doesn't have a clue when it comes to headers > > and > > > footers, and although it renders them in the > > table, > > > they will not appear at the top and bottom of > > every > > > printed page." > > > So, it looks like you're taking advantage of > IE's > > > non-sta ndard tfoot printed presentation and > > wanting > > > Mozilla to do the same. Perhaps you could > > redefined > > > tfoot's presentation t hrough css so that it only > > > prints at the bottom of the page. Though I > don't > > > have an answer for you, I hope this sheds some > > light > > > into your problem. > > > > > > -Jorge > > > > > > pankaj singla <[EMAIL PROTECTED]> wrote: > > > > > > Is there any way to control the printiing of > > footer > > > in table to last page only. I am using footer to > > > the Sum of each column in the last line. I am > > using > > > display:table for the table. But while IE is > only > > > showing the footer on last page, Mozilla shows > > > footer > > > on each page. > > > > > > Thanks, > > > > > > > > > > > > ______________________________ ____ > > > Start your day with Yahoo! - Make it your home > > page! > > > > > > http://www.ya h oo.com/r/hs > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by: > > > Power Architecture Resource Center: Free > content, > > > downloads, discussions, > > > and more. > > > http://solutions.newsforge.com/ibmarch.tmpl > > > _______________________________________________ > > > displaytag-user mailing list > > > [email protected] > > > > > > https://lists.sourceforge.net/lists/listinfo/displaytag-user & gt; > > > > > > > > --------------------------------- > === message truncated === __________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ displaytag-user mailing list [email protected] https://li sts.sourceforge.net/lists/listinfo/displaytag-user |
- [displaytag-user] Hiding table footer in some pages pankaj singla
- Re: [displaytag-user] Hiding table footer in some ... Jorge Barroso
- Re: [displaytag-user] Hiding table footer in some ... Jorge Barroso
- Re: [displaytag-user] Hiding table footer in some ... Christopher Becker
- Re: [displaytag-user] Hiding table footer in s... Jorge Barroso
- Re: [displaytag-user] Hiding table footer in some ... Christopher Becker
- Re: [displaytag-user] Hiding table footer in s... Jorge Barroso
- Re: [displaytag-user] Hiding table footer in some ... Christopher Becker
- Re: [displaytag-user] Hiding table footer in s... Jorge Barroso
- Re: [displaytag-user] Hiding table footer ... Jorge Barroso
- Re: [displaytag-user] Hiding table footer in some ... Christopher Becker
- Re: [displaytag-user] Hiding table footer in some ... Jorge Barroso

