diff src/main/webapp/home/searchPage.xhtml @ 5:5316e79f9a27

Implementation of search pagination and lazy loading to display the result set of a search.
author "jurzua <jurzua@mpiwg-berlin.mpg.de>"
date Mon, 16 Mar 2015 11:25:36 +0100
parents 7682c04c63a8
children
line wrap: on
line diff
--- a/src/main/webapp/home/searchPage.xhtml	Wed Mar 11 16:32:06 2015 +0100
+++ b/src/main/webapp/home/searchPage.xhtml	Mon Mar 16 11:25:36 2015 +0100
@@ -34,9 +34,42 @@
 					
 					<h:outputLabel value="#{sessionBean.searchPage.message}"/>
 					
-					<h:panelGrid columns="1" rendered="#{!empty sessionBean.searchPage.sectionList}" style="width: 90%; margin-left: auto;margin-right: auto;">
-						<ace:dataTable var="section" value="#{sessionBean.searchPage.sectionList}">
-							 <ace:column headerText="Book Id">
+					<h:panelGrid columns="1" rendered="#{!empty sessionBean.searchPage.completeSectionList}" 
+						style="width: 90%; margin-left: auto;margin-right: auto;text-align: center;" styleClass="centerTable">
+						
+					    <h:panelGroup >
+							<h:commandButton image="#{appBean.paginatorFirst}"
+					            style="border:none;" title="First Page" 
+					            action="#{sessionBean.searchPage.advancedFirst}"/> 
+					            
+					        <h:commandButton image="#{appBean.paginatorFr}"
+					            style="border:none;" title="Fast Backwards" 
+					            action="#{sessionBean.searchPage.advancedFastRewind}"/> 
+					            
+					        <h:commandButton image="#{appBean.paginatorPrevious}"
+					            style="border:none;" title="Previous Page" 
+					            action="#{sessionBean.searchPage.advancedPrevious}"/>     
+					            
+					        <h:outputLabel value="#{sessionBean.searchPage.advancedPaginator.recordStatus}"/> 
+					            
+					        <h:commandButton image="#{appBean.paginatorNext}"
+					            style="border:none;" title="Next Page" 
+					            action="#{sessionBean.searchPage.advancedNext}"/>
+					            
+					        <h:commandButton image="#{appBean.paginatorFf}"
+					            style="border:none;" title="Fast Forward" 
+					            action="#{sessionBean.searchPage.advancedFastForward}"/>      
+					            
+					            <h:commandButton image="#{appBean.paginatorLast}"
+					            style="border:none;" title="Last Page" 
+					            action="#{sessionBean.searchPage.advancedLast}"/>      
+					    </h:panelGroup>
+						
+						<ace:dataTable 
+							var="section" 
+							value="#{sessionBean.searchPage.currentSectionList}">
+							
+							<ace:column headerText="Book Id">
 							 	<h:outputText value="#{section.book.id}"/>
 							 </ace:column>
 							 <ace:column headerText="Book Name">
@@ -62,10 +95,10 @@
 							 </ace:column>
 							 <ace:column headerText="Create Branch">
 							 	<h:commandButton 
-							 		value="Create Branch in Extraction Interface"
-							 		title="Create Branch in Extraction Interface" 
+							 		value="Show Section in Extraction Interface"
+							 		title="Show Section in Extraction Interface" 
 							 		onclick="sectionInExtractionInterface(#{section.id}, '#{section.name}', #{section.book.id}, '#{section.book.name}', #{sessionBean.user.id}, '#{appBean.extractionInterfaceUrl}');"
-							 		image="#{appBean.newBranchImage}"/>
+							 		image="#{appBean.showImage}"/>
 							 </ace:column>								 
 							 <ace:column headerText="Existing Branches">
 							 	<ace:dataTable value="#{section.branches}" var="branch" rendered="#{!empty 	section.branches}">
@@ -85,8 +118,40 @@
 										</h:outputLink>
 							 		</ace:column>
 							 	</ace:dataTable>
-							 </ace:column>
-						</ace:dataTable>
+							 </ace:column>							
+							
+						</ace:dataTable>						
+						
+					    <h:panelGroup >
+							<h:commandButton image="#{appBean.paginatorFirst}"
+					            style="border:none;" title="First Page" 
+					            action="#{sessionBean.searchPage.advancedFirst}"/> 
+					            
+					        <h:commandButton image="#{appBean.paginatorFr}"
+					            style="border:none;" title="Fast Backwards" 
+					            action="#{sessionBean.searchPage.advancedFastRewind}"/> 
+					            
+					        <h:commandButton image="#{appBean.paginatorPrevious}"
+					            style="border:none;" title="Previous Page" 
+					            action="#{sessionBean.searchPage.advancedPrevious}"/>     
+					            
+					        <h:outputLabel value="#{sessionBean.searchPage.advancedPaginator.recordStatus}"/> 
+					            
+					        <h:commandButton image="#{appBean.paginatorNext}"
+					            style="border:none;" title="Next Page" 
+					            action="#{sessionBean.searchPage.advancedNext}"/>
+					            
+					        <h:commandButton image="#{appBean.paginatorFf}"
+					            style="border:none;" title="Fast Forward" 
+					            action="#{sessionBean.searchPage.advancedFastForward}"/>      
+					            
+					            <h:commandButton image="#{appBean.paginatorLast}"
+					            style="border:none;" title="Last Page" 
+					            action="#{sessionBean.searchPage.advancedLast}"/>      
+					    </h:panelGroup>					
+					
+					
+					
 					</h:panelGrid>