• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem paging HTML table

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to "page" (break into segments) a HTML table.

I iterate through the table entries with the JSTL <forEach> tag.

My paging logic is encapsulated in a class where I maintain the itemsCollection and the current page indexes. I have two buttons on the JSP page for the user to scroll the itemsCollection forward or backward.
The problem is that the scrolling function will skip every other scroll group. Example: There are 15 items in the collection. The table initially display items 1 thru 5. Click the Next button and items 11 thru 15 are displayed. Click the Prev button and items 1 thru 5 are displayed. Items 6 thru 10 are skipped. Moreover, this problem is intermittent. Sometimes items 6 thru 10 will display in either the forward or backward direction, but I can't predict or control when that will happen.
I'm pretty sure this is not a fault in my paging logic. I've tracked it in the debugger, and what happens when a segment is skipped is that the JSP page is never rendered. The Struts action is called again as if the page had been rendered and the Next button had been clicked, but of course that did not happen (at least there doesn't seem to be any telltale flicker of the screen as I would expect to see if the page were rendered again). My action class returns only one mapping, "Success", and that maps to the JSP page in question.
What I've tried so far is substituted JSTL's <c:url> tags for the <html:link> tags, but that made no difference. Any help?
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Andre,
You can try this.

1.Take two variables as Upper and Lower Limits.Use this as Begin and End Elements(position) of ur collection.
2.Page Load Condition : Upp as 1 and Low as 5.
2.Next Condition : change the values : put Low+1 as Upp and Low+5 as Low.
3.Prev Condition : change the values : put Upp-5 as Upp and Upp-1 as Low.
4.Enable/Disable Next/Prev Buttons accordingly.

Thanks
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic