This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts display:table tag pagination issue

 
Jack Tian
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys:

I have a .jsp that uses the display:table mechanism for displaying a table, i.e.:
<display:table name="myName" id="camp" cellspacing="2" cellpadding="0" defaultsort="3" sort="list" pagesize="10" requestURI="<%=myURI%>" width="100%">
It appears that it handles pagination automatically - i.e. pagesize will display 10 rows and then does a page break.

What I need to do is this:

In my app this display:table mechanism displays a series of row - each row has a link that can take them to another page - on the other page - there is a link that will bring them back to this orignal .jsp with the above code - but when they come back they want to come back to the paginated page from whence they came - so if they were on paginated page 2 when they left - they want to come back to paginated page 2 rather than page 1, which looks like the default - (to prevent them from having to re-navigate from when they came). I would think this is a very common issue.

 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm.....

This is interesting, but how would you set up the link in the 2nd jsp page to come back to the 2nd pagination of display:table

I have an idea maybe you can try

when you click the pagination 2, there is extra parameter in the URL that shows it's 2nd page of display:table

find out what that is

and use <c:set> at the page2.jsp to set that request parameter

my guess is you have to do some testing to see how it would work if you click a link from pagination 1

Hope this helps
 
Jack Tian
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jack Tian wrote:Guys:

I have a .jsp that uses the display:table mechanism for displaying a table, i.e.:
<display:table name="myName" id="camp" cellspacing="2" cellpadding="0" defaultsort="3" sort="list" pagesize="10" requestURI="<%=myURI%>" width="100%">
It appears that it handles pagination automatically - i.e. pagesize will display 10 rows and then does a page break.

What I need to do is this:

In my app this display:table mechanism displays a series of row - each row has a link that can take them to another page - on the other page - there is a link that will bring them back to this orignal .jsp with the above code - but when they come back they want to come back to the paginated page from whence they came - so if they were on paginated page 2 when they left - they want to come back to paginated page 2 rather than page 1, which looks like the default - (to prevent them from having to re-navigate from when they came). I would think this is a very common issue.



The issue is resolved based on your advice.
Thanks.
 
Amogh Mhatre
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or you can simply use keepStatus="true"

<display:table name="myName" id="camp" cellspacing="2" cellpadding="0" defaultsort="3" sort="list" keepStatus="true" pagesize="10" requestURI="<%=myURI%>" width="100%">
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic