Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
Struts
pagination problem
madhuri kunchala
Ranch Hand
Posts: 350
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi,
in my application i used pagination..im using
Struts
2..i m getting error as
Nothing found to display
..i m using hibernate...i had called the class name in display tag..can any one help me out..
<%@page contentType="text/html" pageEncoding="UTF-8"%> <%@taglib uri="/struts-tags" prefix="s" %> <%@taglib uri="http://displaytag.sf.net" prefix="display" %> <s:form action="manage" namespace="/appcontent" method="POST" theme="simple"> <table> <tr> <td > Filter By </td> <td> <s:select label="Filter By " name="filterby" id="filterby" headerKey="-1" headerValue="ALL" list="#{1:'ContentID',2:'Charge',3:'Approval State',4:'Rating', 5:'Content Owner Name',6:'Expiry Date',7:'Created Date'}" onchange="showhide();" /> </td> </tr> <tr id="firstdiv" > <td> Enter Search Value </td> <td> <s:textfield label="Enter Search Value " name="search" id="search"/> </td> <td> <s:submit name="search" id="search" value="Search" method="Search"/> </td> </tr> <tr id="seconddiv" > <td> Start Date </td> <td> <s:textfield name="startDate" label="startdate" id="startDate"/> </td> <td> End Date </td> <td> <s:textfield name="endDate" label="endDate" id="endDate"/> </td> <td> <s:submit value="Search" align="center" method="DateSearch"/> </td> </tr> </table> <display:table id="apps" name="appList" pagesize="5" export="false" requestURI="com.nxl.content.application.manage.ManageApps.java"> <display:column property="contentId" title="Content Id" href="show.do" paramId="contentid" sortable="true"/> <display:column property="title" title="Title" sortable="true" /> <display:column property="description" title="Description" sortable="true" /> <display:column property="charge" title="Charge" sortable="true" /> <display:column property="rating" title="Rating" sortable="true" /> <display:column property="tags" title="Tags" sortable="true" /> <display:column property="expirydate" title="Expiry Date" sortable="true"/> <display:column property="approvalstate" title="Approval State" sortable="true" /> <display:column property="contentownerid" title="Content Owner Id" sortable="true" /> <display:column property="contentpublisherid" title="Content Publisher Id" sortable="true" /> <display:column property="modeofupload" title="Mode Of Upload" sortable="true"/> <display:column property="userwatermark" title="User WaterMark" sortable="true"/> <display:column property="creationdate" title="Creation Date" sortable="true" /> <display:column title="" property="editLink" url="/delete.do" paramId="empId" paramProperty="empId" /> <display:column title="" property="deleteLink" url="/edit.do" paramId="empId" paramProperty="empId" /> <display:setProperty name="paging.banner.placement" value="top" /> </display:table> <s:submit align="center"/> </s:form>
madhuri kunchala
Ranch Hand
Posts: 350
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi good morning,
i had given 'list="appsList"' in <display tag> im getting only the 'appsList' name in the browser...can any one help me out..
madhuri kunchala
Ranch Hand
Posts: 350
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi,
i tried in another way using js for pagination...even though im not getting..here is the code...can any one help me out..
<style type="text/css"> .pg-normal { color: #0000FF; font-weight: normal; text-decoration: none; cursor: pointer; } .pg-selected { color: #800080; font-weight: bold; text-decoration: underline; cursor: pointer; } </style> <script type="text/javascript"> function Pager(tableName, itemsPerPage) { this.tableName = tableName; this.itemsPerPage = itemsPerPage; this.currentPage = 1; this.pages = 0; this.inited = false; this.showRecords = function(from, to) { var rows = document.getElementById(tableName).rows; // i starts from 1 to skip table header row for (var i = 1; i < rows.length; i++) { if (i < from || i > to) rows[i].style.display = 'none'; else rows[i].style.display = ''; } } this.showPage = function(pageNumber) { if (! this.inited) { alert("not inited"); return; } var oldPageAnchor = document.getElementById('pg'+this.currentPage); oldPageAnchor.className = 'pg-normal'; this.currentPage = pageNumber; var newPageAnchor = document.getElementById('pg'+this.currentPage); newPageAnchor.className = 'pg-selected'; var from = (pageNumber - 1) * itemsPerPage + 1; var to = from + itemsPerPage - 1; this.showRecords(from, to); } this.prev = function() { if (this.currentPage > 1) this.showPage(this.currentPage - 1); } this.next = function() { if (this.currentPage < this.pages) { this.showPage(this.currentPage + 1); } } this.init = function() { var rows = document.getElementById(tableName).rows; var records = (rows.length - 1); this.pages = Math.ceil(records / itemsPerPage); this.inited = true; } this.showPageNav = function(pagerName, positionId) { if (! this.inited) { alert("not inited"); return; } var element = document.getElementById(positionId); var pagerHtml = '<span onclick="' + pagerName + '.prev();" class="pg-normal"> « Prev </span> | '; for (var page = 1; page <= this.pages; page++) pagerHtml += '<span id="pg' + page + '" class="pg-normal" onclick="' + pagerName + '.showPage(' + page + ');">' + page + '</span> | '; pagerHtml += '<span onclick="'+pagerName+'.next();" class="pg-normal"> Next ยป</span>'; element.innerHTML = pagerHtml; } } </script><table id="manage" border="1" class="headertable" > <thead> <tr> <th > ContentID </th> <th > Title </th> <th > Description </th> <th > Charge </th> <th > Rating </th>..and the code goes on at the end of form </table> <div id="pageNavPosition"></div> </s:form> <script type="text/javascript"><!-- var pager = new Pager('manage', 3); pager.init(); pager.showPageNav('pager', 'pageNavPosition'); pager.showPage(1); //--></script>
im getting error as
rows is undefined
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
problem in field validation
Struts 2 validation not working
DisplayTag works but without colors!?
DisplayTag problem to export Excel not working
How to pass multiple parameters. Displaytag row value not changing on dynamic link
More...