aspose file tools*
The moose likes Struts and the fly likes struts display:table tag pagination issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts display:table tag pagination issue" Watch "struts display:table tag pagination issue" New topic
Author

struts display:table tag pagination issue

Jack Tian
Greenhorn

Joined: Sep 14, 2009
Posts: 5
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

Joined: Aug 05, 2007
Posts: 294
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

Joined: Sep 14, 2009
Posts: 5
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

Joined: Jan 28, 2011
Posts: 1
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%">
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts display:table tag pagination issue