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?
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.