• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pagging Problem

 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,



The above code output is correct until the page no 5 but when the page goes to 6 then its adding like 1 2 3 4 5 6 and on clicking 7 it showing again from start like: 1 2 3 4 5

Kindly help me to fix this problem

Best regards
 
Winston Gutkowski
Bartender
Pie
Posts: 10273
60
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Farakh khan wrote:The above code output is correct until the page no 5 but when the page goes to 6 then its adding like 1 2 3 4 5 6 and on clicking 7 it showing again from start like: 1 2 3 4 5

I'm afraid your code lost me at 'noOfPagesPerPage'. I also don't see anything to do with "clicking".

Perhaps it would be easier if you explain what it is you're trying to do.

Winston
 
Paul Clapham
Sheriff
Posts: 20983
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't want the numbers to always start at 1, then do something about line 32 in your post which says "Start at 1".
 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:
Perhaps it would be easier if you explain what it is you're trying to do.
Winston

Thanks for your reply

I have huge amount of data in my Oracle table to display. I am trying to display some records per page basis. This piece of code fulfil my requirements but not working properly. start, end,next, previous, first and last page working fine but I am trying to display 5 page numbers per page. Its also working for first time but when the page becomes 6 then its adding 6 number in previous page nos. On display of 7 page it display again 1-5 page nos instead of 6-10 pages to go a head

Thanks again
 
Winston Gutkowski
Bartender
Pie
Posts: 10273
60
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Farakh khan wrote:I have huge amount of data in my Oracle table to display. I am trying to display some records per page basis.

OK, with you so far.

This piece of code fulfil my requirements but not working properly. start, end,next, previous, first and last page working fine but I am trying to display 5 page numbers per page.

And this is where you lose me. What do you mean by 'displaying 5 page numbers per page'? It's either a page or it isn't, surely? Why not just display the current page number?
Assuming you're numbering your records from 1, that would simply be:
1 + ([current start record - 1] / number of records per page) (which looks like it's 5 in your case)

But maybe I'm missing something somewhere.

Winston

 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:If you don't want the numbers to always start at 1, then do something about line 32 in your post which says "Start at 1".


I tried many ways but I am so silly to not understand. Can you please get me any clue?

Best regards
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic