This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Pagging Problem

 
Ranch Hand
Posts: 851
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 26910
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 851
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 851
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic