Renames "controls" to "pz2widgets"
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Fri, 1 Mar 2013 00:46:09 +0000 (19:46 -0500)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Fri, 1 Mar 2013 00:46:09 +0000 (19:46 -0500)
src/META-INF/resources/pz2widgets/pager.xhtml [new file with mode: 0644]

diff --git a/src/META-INF/resources/pz2widgets/pager.xhtml b/src/META-INF/resources/pz2widgets/pager.xhtml
new file mode 100644 (file)
index 0000000..3d7a8d2
--- /dev/null
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" ?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<h:html xmlns="http://www.w3.org/1999/xhtml"\r
+      xmlns:f="http://java.sun.com/jsf/core"\r
+      xmlns:h="http://java.sun.com/jsf/html"\r
+      xmlns:ui="http://java.sun.com/jsf/facelets"\r
+      xmlns:composite="http://java.sun.com/jsf/composite">\r
+\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+</head>\r
+<body>\r
+\r
+  <composite:interface>\r
+    <composite:attribute name="renderOnChange" required="true"/>\r
+    \r
+    <composite:attribute name="visiblePageRange" required="false" default="13"/>    \r
+    <composite:attribute name="prevLabel" required="false" default="&lt;&lt;Prev"/>\r
+    <composite:attribute name="nextLabel" required="false" default="Next&gt;&gt;"/>\r
+    <composite:attribute name="morePagesIndicator" required="false" default="..."/>\r
+    <composite:attribute name="textBeforeFirst" required="false" default="| "/>\r
+    <composite:attribute name="textAfterLast" required="false" default="| "/> \r
+  </composite:interface>\r
+  \r
+  <composite:implementation>\r
+\r
+    <h:panelGrid columns="1" width="100%" rendered="#{pz2.hasRecords()}"><h:panelGroup>\r
+      <h:outputText id="instantiatePager" value="#{pz2.setPager(cc.attrs.visiblePageRange)}" style="display: none;" />\r
+                 \r
+      <h:commandLink value="#{cc.attrs.prevLabel}" \r
+                     action="#{pz2.pager.goToPreviousPage()}" \r
+                     rendered="#{pz2.pager.hasPreviousPage()}">\r
+         <f:ajax render="#{cc.attrs.renderOnChange}" />                                    \r
+      </h:commandLink> \r
+             \r
+      <h:outputText value=" "/>\r
+                         \r
+      <h:outputText value="#{cc.attrs.prevLabel}" rendered="#{not pz2.pager.hasPreviousPage()}"/>\r
+            \r
+      <b><h:outputText value="#{cc.attrs.textBeforeFirst}"/></b>\r
+    \r
+      <ui:repeat var="pageLink" value="#{pz2.pager.pageLinks}" varStatus="status">\r
+                           \r
+        <h:commandLink value="#{pageLink.text}" \r
+                       action="#{pz2.pager.goToPage(pageLink.page)}" \r
+                       rendered="#{pageLink.page!=pz2.pager.currentPage}">\r
+          <f:ajax render="#{cc.attrs.renderOnChange}" />            \r
+        </h:commandLink>\r
+        \r
+        <b><h:outputText value="#{pageLink.text}" rendered="#{pageLink.page==pz2.pager.currentPage}"/> </b>\r
+                                               \r
+      </ui:repeat>\r
+      \r
+      <h:outputText value="#{cc.attrs.morePagesIndicator}" rendered="#{pz2.pager.hasPageAfterLastDisplayed()}"/>\r
+        \r
+      <b><h:outputText value="#{cc.attrs.textAfterLast}" /></b>\r
+                     \r
+      <h:commandLink value="#{cc.attrs.nextLabel}" \r
+                     action="#{pz2.pager.goToNextPage()}" \r
+                     rendered="#{pz2.pager.hasNextPage()}">            \r
+        <f:ajax render="#{cc.attrs.renderOnChange}" />\r
+      </h:commandLink>\r
+                \r
+      <h:outputText value="#{cc.attrs.nextLabel}" rendered="#{not pz2.pager.hasNextPage()}"/>\r
+        \r
+    </h:panelGroup></h:panelGrid>\r
+  </composite:implementation>\r
+</body>\r
+</h:html>
\ No newline at end of file