Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pagination?

 
Rachel Kumar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i implement this below view to navigate between pages.
i mean what do i start off with?
is it not pagination?
where can i get more examples on this?

--------------------------------
Issue 1 of 13 issue(s)
<< Previous | No:439 | Next >>
--------------------------------

Thanks in Advance.
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use DisplayTag.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

For your refe :- http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html
 
Siva gurun
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Try this code:
<body>
<pg ager url="<%= (String)request.getSession().getAttribute("sessionValue")%>" maxIndexPages="21" export="currentPageNumber=pageNumber" maxPageItems="11" index="center">

<pg aram name="pg"/>
<pg aram name="q"/>

.
.
.
<logic:iterate id="params" name="showMsg" indexId="count">
<pg:item>
.
.
//Items to be paginate
.
.
</pg:item>
</logic:iterate>
<pg:index>
<font class="txtS" color="#646D7E">
<pg:first> <a href="<%= pageUrl %>"> [<b><<</b> First] </pg:first>
<pg rev> <a href="<%= pageUrl %>">[<b><<</b> Prev]</a></pg rev>
<pg ages><%
if (pageNumber.intValue() < 10) {
%> <%
}
if (pageNumber == currentPageNumber) {
%><b><%= pageNumber %></b><%
} else {
%><a href="<%= pageUrl %>"><%= pageNumber %></a><%
}
%>

</pg ages>
<pg:next> <a href="<%= pageUrl %>">[Next <b>>></b>]</a></pg:next>
<pg:last> <a href="<%= pageUrl %>"> [Last <b>>></b>]</pg:last>
<br> </font>
</pg:index>
</pg ager>
</body>
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This same code i may applying in strut2.Its not working.

here is my jsp page code.


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that a question?
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I mean when i try to use pager-taglib2.0 for pagination with strut2.Its not working while indexing.
as its opening blank page when i clicks on next link.

Thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where do you define the scriptlet variable "pageUrl"?
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i used <%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>.





 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That defines the tag library.

Does the tag library expose a scripting variable "pageUrl"? Is the link rendering correctly?
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

yes the tag library expose a scripting variable "pageUrl"

I got this from here.
http://jsptags.com/index.jsp
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, haven't seen that site in awhile. Looks like the last update was ~6 years ago.

I'd sure consider using DisplayTag, since it's somewhat more up-to-date. Otherwise your best bet is to try to find support for the Pager tag library; not sure how to do that.

I don't see in your code where you set the url for the pager, however, so I'm not sure how to help.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic