The method getCurrentPages in org.apache.tapestry.contrib.table.components.TablesPages
returns the current page of your table. The ordinal number of the first row of the current page should be something like (tablesPages.getCurrentPage() - 1) * PAGE_SIZE) + 1 Shing --- [EMAIL PROTECTED] wrote: > I *hope* there's a really straightforward answer to > this and that I'm > just a complete donkey for overlooking it, but. . . > > If you want to have a table that iterates over a > List and (for example) > spit out some properties of each element in the > List, to wit: > > --------------------------- > |Aaron | (202) 123-4567| > --------------------------- > |Bob | (202) 987-6543| > --------------------------- > etc.etc. > > That's really easy. > > But now say you want to just add an ordinal number > as the first column > of the table, like this: > > --------------------------------- > | 1 | Aaron | (202) 123-4567| > --------------------------------- > | 2 | Bob | (202) 987-6543| > --------------------------------- > | 3 | etc. etc. > > That seems to be harder. The only way I see how to > do it is to: > > A) Define a custom columnValue @Block > > B) Map that columnValue to some MyTable.java > getOrdinal() method > > C) In my getOrdinal() method, get the Object > associated with > getTable().getTableRow(); > > D) Assume the "source" data for the Table is a > java.util.List, use the > List.indexOf() method on the Object from step (C) to > figure out what > element it is and return that int value as the > ordinal > > Please tell me I'm a donkey... > > Thanks, > Tom > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > Home page : http://uk.geocities.com/matmsh/index.html Send instant messages to your online friends http://uk.messenger.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]