• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Pagging Problem

 
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
 
Bartender
Posts: 10777
71
Hibernate Eclipse IDE 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
 
Marshal
Posts: 25677
69
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
Posts: 10777
71
Hibernate Eclipse IDE 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
 
Your mother is a hamster and your father smells of tiny ads!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic