Two Laptop Bag*
The moose likes Struts and the fly likes display:table pagination control? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "display:table pagination control?" Watch "display:table pagination control?" New topic
Author

display:table pagination control?

Weston Kornfeld
Greenhorn

Joined: Mar 01, 2005
Posts: 28
Hi,

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="15" requestURI="<%=myURI%>" width="100%">

It appears that it handles pagination automatically - i.e. pagesize will display 15 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 whence they came). I would think this is a very common issue.


Many Thanks
Sarath Mohan
Ranch Hand

Joined: Mar 17, 2001
Posts: 213
You may need to invoke the same logic when user clicks the link on the 'other' page. For this, a parameters needs to be passed when the user clicks link on the 'original' page


Sarath Mohan
Christian Nash
Ranch Hand

Joined: Jan 17, 2006
Posts: 107
Hi all,

Could you please post the sample code for pagination using display tags.

Thanks,
ashwin


- Christian
Vikrama Sanjeeva
Ranch Hand

Joined: Sep 02, 2001
Posts: 756
Hi,

Kornfeld is talking about displayTag Lib (http://displaytag.sourceforge.net). I'm also facing this issue. As for Mohan, calling with same params does not work. It eventually takes the usre the 1st page.

Bye,
Viki.


Count the flowers of your garden, NOT the leafs which falls away!
Prepare IBM Exam 340 by joining http://groups.yahoo.com/group/IBM340Exam/
amit k bhardwaj
Greenhorn

Joined: Jul 29, 2010
Posts: 3
Hi,

Issue: We were facing the issue for display:table pagination control, when on the click of page 2, the UI of page wasn't same as in the page 1. Actually there are js,css and images are missing for next page or whenever we navigate through the page 2 to page1.

Solution: This is happening because in the jsp file we have given the path like below in our case:

<link href="../css/style.css" rel="stylesheet" type="text/css" media="screen" />
<link href="../css/style1.css" rel="stylesheet" type="text/css" media="screen" />

while it should be

<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/style1.css" rel="stylesheet" type="text/css" media="screen" />

This is similer for all the files included into jsp like css, js and images files.

and we have placed the same jsp file directly inside webcontent folder.

Please revert back in case of any query.

Regards,
Amit
Niiraj Patel
Ranch Hand

Joined: Sep 17, 2011
Posts: 47

Quote:
Hi all,

Could you please post the sample code for pagination using display tags.

Thanks,
ashwin


@Nash,

You can have a look at this thread. http://www.coderanch.com/t/554090/Struts/Struts-Display-tag
I have posted eclipse project which uses struts 2.0 and Display tag library 1.2.

-Niraj
amit k bhardwaj
Greenhorn

Joined: Jul 29, 2010
Posts: 3
hello,

Please refer the below link for Display tag use in the code for struts application:

http://www.vaannila.com/struts/struts-example/struts-display-tag-table-decorator-example-1.html

Hope above link will helpful. In case of any other query please write back....


Regards,
Amit
 
Consider Paul's rocket mass heater.
 
subject: display:table pagination control?
 
Similar Threads
pagination
Enabling / Disabling pagination in displaytag
struts display:table tag pagination issue
Pagination
Pagination with display tag