so how did you do it?
-----Original Message-----
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 3:58 PM
To: '[EMAIL PROTECTED]'
Subject: RE: pager tag , iterate tag and displaying data as rows in a
table
Never mind. figured it out myself and it works just fine....
cheers,
Amar..
-----Original Message-----
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 2:30 PM
To: '[EMAIL PROTECTED]'
Subject: pager tag , iterate tag and displaying data as rows in a table
Hi All,
I am using a pager tag that i got from jsptags.com
I am using it in conjunction with the struts logic:iterate tag to spit
out
a bunch of rows.
The question i have is.. Is it possible to get the index of the current
element in the iteration ? The reason for asking this is that i am using
a
unique index for every item in the row ( I am using a Radio Button for
this). When i page back and forth i want to make sure that the unique id
the
client is getting (for every row) is the index to the current element in
the
Collection. If i am paging forward, i should get rows in ascending
order,
and if i am paging backward i should get rows in descending order.
Can anybody help me out here. Thanks a lot.
I am attaching some code (which is not working proplery) here which
should
give people some pointers....
<pg:pager>
<pg:param name="keywords"/>
<logic:iterate id="groupsList" name="statesBean" property="states">
<pg:item>
<html:radio name="statesBean" property="selectedIndex"
value="<%=
statesBean.getIndex() %>" />
<bean:write name="groupsList" property="countryName" />
<html:link page='<%= "/someAction.do?selectedIndex=" +
statesBean.getIndex() %>' > <bean:write name="groupsList"
property="description" /> </html:link>
<BR>
</pg:item>
</logic:iterate>
</pg:param>
</pg:pager>
cheers,
Amar..
smime.p7s