diff src/main/webapp/componentes/paginator.jsp @ 18:881e7591f3e4

new: adding paginator in books page
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 02 Jun 2015 15:09:54 +0200
parents 3e62083dbcbf
children 37840afb7b80
line wrap: on
line diff
--- a/src/main/webapp/componentes/paginator.jsp	Tue Jun 02 11:56:45 2015 +0200
+++ b/src/main/webapp/componentes/paginator.jsp	Tue Jun 02 15:09:54 2015 +0200
@@ -2,7 +2,7 @@
 
 <jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" />
 		
-		
+		<% String formName = request.getParameter("formName"); %>
 		
 		<table style="width: 300px; margin-left: auto;margin-right: auto;">
 			<tr>
@@ -10,38 +10,46 @@
 					<input 
 						type="image"
 						src="<%=sessionBean.getApplicationBean().getPaginatorFirst()%>"
-						onclick="setAction('firstPage', 'searchForm');"/>
+						onclick="setAction('firstPage','<%=formName%>');"/>
 				</td>
 				<td>
 					<input 				
 						type="image"
 						src="<%=sessionBean.getApplicationBean().getPaginatorFr()%>"
-						onclick="setAction('fastRewind', 'searchForm');"/>
+						onclick="setAction('fastRewind', '<%=formName%>');"/>
 				</td>
 				<td>
 					<input 				
 						type="image"
 						src="<%=sessionBean.getApplicationBean().getPaginatorPrevious()%>"
-						onclick="setAction('previousPage', 'searchForm');"/>
+						onclick="setAction('previousPage', '<%=formName%>');"/>
 				</td>
-				<td><%=sessionBean.getSearchPage().getPaginator().getRecordStatus()%></td>
+				<td>
+				<% if (formName.equals("booksForm")) { %>
+					<%=sessionBean.getBooksPage().getPaginator().getRecordStatus() %>
+						
+				<% } else if (formName.equals("searchForm")) { %>
+					<%=sessionBean.getSearchPage().getPaginator().getRecordStatus() %>
+					
+				<% } %>
+				</td>
 				<td>
 					<input 				
 						type="image"
 						src="<%=sessionBean.getApplicationBean().getPaginatorNext()%>"
-						onclick="setAction('nextPage', 'searchForm');"/>
+						onclick="setAction('nextPage', '<%=formName%>');"/>
 				</td>
 				<td>
 					<input 				
 						type="image"
 						src="<%=sessionBean.getApplicationBean().getPaginatorFf()%>"
-						onclick="setAction('fastForward', 'searchForm');"/>
+						onclick="setAction('fastForward', '<%=formName%>');"/>
 				</td>
 				<td>
 					<input 	
 						src="<%=sessionBean.getApplicationBean().getPaginatorLast()%>"						
 						type="image"
-						onclick="setAction('lastPage', 'searchForm');"/>
+						onclick="setAction('lastPage', '<%=formName%>');"/>
 				</td>
 			</tr>
 		</table>
\ No newline at end of file