Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page Total Display

Status
Not open for further replies.

extempore

Programmer
Jun 1, 2001
71
0
0
US
Hi all,

I have created jsp pages which dynamically diplays 9 pictures per page. Now the user wants to have something like (Pic 1-9 of 48 Total) on the page. Can someone tell me how I can do this.

I have <%=pageIndex%> (starts with 0) which gives me the page I am currently on and <%=size%> (48 in this example) the total no of pics.

For e.g if <%=pageIndex%> is 0 then the text should day (Pic 1-9 of 48 Total)

if <%=pageIndex%> is 1 then the text should day (Pic 10-18 of 48 Total)

if <%=pageIndex%> is 2 then the text should day (Pic 19-28 of 48 Total)

Since the <%=pageIndex%> changes based on pagination and the <%=size%> being the same, can someone tell me if this can be achieved? If so can someone give me a code to do this as I am a newbie.

Thanks and regards.
 
ummm... how about low = (pageIndex * 9) - 9 and high = low + 9

??

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top