If you want to show the row num in front of each row, take an user (with bean 
property lastname and firstname) list for example, I assume your data source 
'userSource' is prepared.

<table t:type="grid" t:source="userSource" add="rowNumber" reorder="rowNumber" 
rowIndex="var:rowIndex">
    <p:rowNumber>
        ${var:rowIndex}
    </p:rowNumber>
</table>

Note: It begins from 0. And I haven't test it at all but should almost work.

DH
http://www.gaonline.com.cn

----- Original Message ----- 
From: "cleverpig" <greatclever...@gmail.com>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Thursday, September 17, 2009 8:57 AM
Subject: Re: T5:how to use rowIndex in Grid component?


anyone have idea on this?

On Wed, Sep 16, 2009 at 8:06 PM, cleverpig <greatclever...@gmail.com> wrote:
> I got this define from tapestry5's guide document:
> http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html
>
> rowIndex:Optional output parameter (only set during rendering) that
> identifies the current row index. This is the index on the page (i.e.,
> always numbered from zero) as opposed to the row index inside the
> GridDataSource.
>
> I think this is a row number property that can be used to display row
> number in front of each row.
> but i can't find what's useful example code for developer.
>
> Newbie need help now! and i will help other with my best!~
> --
> cleverpig(Dan)
> Location: Beijing
> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
> Zipcode: 100031
> MSN: great_liu...@hotmail.com
> QQ: 149291732
> Skype: cleverpigatmatrix
> Facebook ID:cleverpig
> Blog: www.cleverpig.name
> Tags: del.icio.us/cleverpig
> Twitter: twitter.com/cleverpig
> 新浪微博: t.sina.com.cn/cleverpig
> Organization: www.beijing-open-party.org
> or...@facebook: http://www.facebook.com/group.php?gid=8159558294
>



-- 
cleverpig(Dan)
Location: Beijing
Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China
Zipcode: 100031
MSN: great_liu...@hotmail.com
QQ: 149291732
Skype: cleverpigatmatrix
Facebook ID:cleverpig
Blog: www.cleverpig.name
Tags: del.icio.us/cleverpig
Twitter: twitter.com/cleverpig
新浪微博: t.sina.com.cn/cleverpig
Organization: www.beijing-open-party.org
or...@facebook: http://www.facebook.com/group.php?gid=8159558294

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to