{"id":1119,"date":"2012-04-11T04:00:00","date_gmt":"2012-04-11T04:00:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/lazy-jsf-primefaces-datatable-pagination-part-2.html"},"modified":"2012-10-21T23:34:55","modified_gmt":"2012-10-21T23:34:55","slug":"lazy-jsf-primefaces-datatable_11","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html","title":{"rendered":"Lazy JSF Primefaces Datatable Pagination &#8211; Part 2"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">The page code is very simple and there is no complication. Check the \u201cindex.xhtml\u201d code: <\/p>\n<pre class=\"brush:java\">&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\"&gt;\r\n&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\" xmlns:ui=\"http:\/\/java.sun.com\/jsf\/facelets\"\r\n    xmlns:h=\"http:\/\/java.sun.com\/jsf\/html\" xmlns:f=\"http:\/\/java.sun.com\/jsf\/core\" xmlns:p=\"http:\/\/primefaces.org\/ui\"&gt;\r\n&lt;h:head&gt;\r\n&lt;\/h:head&gt;\r\n&lt;h:body&gt;\r\n    &lt;f:view&gt;\r\n        &lt;h:form&gt;\r\n            &lt;p:dataTable id=\"lazyDataTable\" value=\"#{playerMB.allPlayers}\" var=\"player\" paginator=\"true\" rows=\"10\"\r\n                selection=\"#{playerMB.player}\" selectionMode=\"single\"\r\n                paginatorTemplate=\"{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}\"\r\n                rowsPerPageTemplate=\"5,10,15\" style=\"width: 80%;margin-left: 10%;margin-right: 10%;\"&gt;\r\n\r\n                &lt;p:ajax event=\"rowSelect\" update=\":playerDialogForm\" oncomplete=\"playerDetails.show()\" \/&gt;\r\n\r\n                &lt;p:column&gt;\r\n                    &lt;f:facet name=\"header\"&gt;Name&lt;\/f:facet&gt;\r\n                    &lt;h:outputText value=\"#{player.name}\" \/&gt;\r\n                &lt;\/p:column&gt;\r\n                &lt;p:column&gt;\r\n                    &lt;f:facet name=\"header\"&gt;Age&lt;\/f:facet&gt;\r\n                    &lt;h:outputText value=\"#{player.age}\" \/&gt;\r\n                &lt;\/p:column&gt;\r\n            &lt;\/p:dataTable&gt;\r\n        &lt;\/h:form&gt;\r\n\r\n        &lt;p:dialog widgetVar=\"playerDetails\" header=\"Player\" modal=\"true\"&gt;\r\n            &lt;h:form id=\"playerDialogForm\"&gt;\r\n                &lt;h:panelGrid columns=\"2\"&gt;\r\n                    &lt;h:outputText value=\"Id: \" \/&gt;\r\n                    &lt;h:outputText value=\"#{playerMB.player.id}\" \/&gt;\r\n                    &lt;h:outputText value=\"Name: \" \/&gt;\r\n                    &lt;h:outputText value=\"#{playerMB.player.name}\" \/&gt;\r\n                    &lt;h:outputText value=\"Age: \" \/&gt;\r\n                    &lt;h:outputText value=\"#{playerMB.player.age}\" \/&gt;\r\n                &lt;\/h:panelGrid&gt;\r\n            &lt;\/h:form&gt;\r\n        &lt;\/p:dialog&gt;\r\n    &lt;\/f:view&gt;\r\n&lt;\/h:body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>We got a lazy datatable that will display a selected value in a dialog.  <\/p>\n<p>In our Managed Bean we have a simpler code than the page: <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\"brush:java\">package com.mb;\r\n\r\nimport java.io.Serializable;\r\n\r\nimport javax.faces.bean.ManagedBean;\r\nimport javax.faces.bean.ViewScoped;\r\n\r\nimport org.primefaces.model.LazyDataModel;\r\n\r\nimport com.model.Player;\r\n\r\n@ViewScoped\r\n@ManagedBean\r\npublic class PlayerMB implements Serializable {\r\n\r\n    private static final long serialVersionUID = 1L;\r\n    private LazyDataModel&lt;Player&gt; players = null;\r\n    private Player player;\r\n\r\n    public LazyDataModel&lt;Player&gt; getAllPlayers() {\r\n        if (players == null) {\r\n            players = new PlayerLazyList();\r\n        }\r\n\r\n        return players;\r\n    }\r\n\r\n    public Player getPlayer() {\r\n        if(player == null){\r\n            player = new Player();\r\n        }\r\n\r\n        return player;\r\n    }\r\n\r\n    public void setPlayer(Player player) {\r\n        this.player = player;\r\n    }\r\n}\r\n<\/pre>\n<p>We got a get\/set to the Player entity and a get to the an object of the LazyDataModel type.<br \/>\nCheck bellow the implementation of the PlayerLazyList code <\/p>\n<pre class=\"brush:java\">package com.mb;\r\n\r\nimport java.util.List;\r\nimport java.util.Map;\r\n\r\nimport org.primefaces.model.LazyDataModel;\r\nimport org.primefaces.model.SortOrder;\r\n\r\nimport com.connection.MyTransaction;\r\nimport com.dao.PlayerDAO;\r\nimport com.model.Player;\r\n\r\npublic class PlayerLazyList extends LazyDataModel&lt;Player&gt; {\r\n\r\n    private static final long serialVersionUID = 1L;\r\n\r\n    private List&lt;Player&gt; players;\r\n\r\n    private MyTransaction transaction;\r\n\r\n    private PlayerDAO playerDAO;\r\n\r\n    @Override\r\n    public List&lt;Player&gt; load(int startingAt, int maxPerPage, String sortField, SortOrder sortOrder, Map&lt;String, String&gt; filters) {\r\n        try {\r\n            try {\r\n                transaction = MyTransaction.getNewTransaction();\r\n                playerDAO =  new PlayerDAO(transaction);\r\n\r\n                transaction.begin();\r\n\r\n                \/\/ with datatable pagination limits\r\n                players = playerDAO.findPlayers(startingAt, maxPerPage);\r\n\r\n                \/\/ If there is no player created yet, we will create 100!!\r\n                if (players == null || players.isEmpty()) {\r\n                    playerDAO.create100Players();\r\n\r\n                    \/\/ we will do the research again to get the created players\r\n                    players = playerDAO.findPlayers(startingAt, maxPerPage);\r\n                }\r\n            } finally {\r\n                transaction.commit();\r\n            }\r\n        } catch (Exception e) {\r\n            e.printStackTrace();\r\n        }\r\n\r\n        \/\/ set the total of players\r\n        if(getRowCount() &lt;= 0){\r\n            setRowCount(playerDAO.countPlayersTotal());\r\n        }\r\n\r\n        \/\/ set the page dize\r\n        setPageSize(maxPerPage);\r\n\r\n        return players;\r\n    }\r\n\r\n    @Override\r\n    public Object getRowKey(Player player) {\r\n        return player.getId();\r\n    }\r\n\r\n    @Override\r\n    public Player getRowData(String playerId) {\r\n        Integer id = Integer.valueOf(playerId);\r\n\r\n        for (Player player : players) {\r\n            if(id.equals(player.getId())){\r\n                return player;\r\n            }\r\n        }\r\n\r\n        return null;\r\n    }\r\n}\r\n<\/pre>\n<p>About the code above:<\/p>\n<ul style=\"text-align: left\">\n<li>The load method: the Primefaces will invoke this method every time that the pagination is fired. It will have all parameters with valid values; with these parameters you will be able to do a query in the database getting only for the needed data. If you want to sort your query by a field you can use the sortField attribute that will have the column datatable value (it will be null if the user do not order); the sortOrder will indicate if the user wants ascending or descending.<\/li>\n<li>The getRowKey method:  this method return an id to each line, the Primefaces will invoke this method when needed.<\/li>\n<li>The getRowData method: will return a selected Player in the datatable.<\/li>\n<li>When you run this application the first time it will persist 100 players in the database. In a real application this would not be necessary.&nbsp;<\/li>\n<\/ul>\n<p>A last configuration need to be added in the \u201cweb.xml\u201d file:  <\/p>\n<pre class=\"brush:xml\">&lt;persistence-context-ref&gt;\r\n    &lt;persistence-context-ref-name&gt;JSFPU&lt;\/persistence-context-ref-name&gt;\r\n    &lt;persistence-unit-name&gt;JSFPU&lt;\/persistence-unit-name&gt;\r\n&lt;\/persistence-context-ref&gt;\r\n<\/pre>\n<p>We will use this configuration to do the JNDI Lookup. <\/p>\n<p><strong>Running our application  <\/strong><\/p>\n<p>Now we just need to start up the application.  <\/p>\n<p>To access the application you can use the link:   <\/p>\n<p><a href=\"http:\/\/localhost:8080\/DatatableLazyPrimefaces\/\">http:\/\/localhost:8080\/DatatableLazyPrimefaces\/<\/a><\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/-lbs4E-U8hjI\/T4GqpVKT9OI\/AAAAAAAAAHo\/QwuheljHqms\/s1600\/01.png\"><img decoding=\"async\" border=\"0\" height=\"205\" src=\"http:\/\/3.bp.blogspot.com\/-lbs4E-U8hjI\/T4GqpVKT9OI\/AAAAAAAAAHo\/QwuheljHqms\/s400\/01.png\" width=\"400\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/-UptfNR-_tSM\/T4Gqz_ckptI\/AAAAAAAAAHw\/jO7tPbM51Uc\/s1600\/02.png\"><img decoding=\"async\" border=\"0\" height=\"208\" src=\"http:\/\/3.bp.blogspot.com\/-UptfNR-_tSM\/T4Gqz_ckptI\/AAAAAAAAAHw\/jO7tPbM51Uc\/s400\/02.png\" width=\"400\" \/><\/a><\/div>\n<p><a href=\"https:\/\/sites.google.com\/site\/uaihebertdeposito\/DatatableLazyPrimefaces.zip?attredirects=0&amp;d=1\">Click here to download the source code of this post.<\/a> <\/p>\n<p><strong><i>Reference: <\/i><\/strong><a href=\"http:\/\/uaihebert.com\/?p=1120&amp;page=4\">Lazy JSF Datatable Pagination (Primefaces) <\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Hebert Coelho at the <a href=\"http:\/\/uaihebert.com\/\">uaiHebert<\/a> blog. <\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The page code is very simple and there is no complication. Check the \u201cindex.xhtml\u201d code: &lt;!DOCTYPE html PUBLIC &#8220;-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN&#8221; &#8220;http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd&#8221;&gt; &lt;html xmlns=&#8221;http:\/\/www.w3.org\/1999\/xhtml&#8221; xmlns:ui=&#8221;http:\/\/java.sun.com\/jsf\/facelets&#8221; xmlns:h=&#8221;http:\/\/java.sun.com\/jsf\/html&#8221; xmlns:f=&#8221;http:\/\/java.sun.com\/jsf\/core&#8221; xmlns:p=&#8221;http:\/\/primefaces.org\/ui&#8221;&gt; &lt;h:head&gt; &lt;\/h:head&gt; &lt;h:body&gt; &lt;f:view&gt; &lt;h:form&gt; &lt;p:dataTable id=&#8221;lazyDataTable&#8221; value=&#8221;#{playerMB.allPlayers}&#8221; var=&#8221;player&#8221; paginator=&#8221;true&#8221; rows=&#8221;10&#8243; selection=&#8221;#{playerMB.player}&#8221; selectionMode=&#8221;single&#8221; paginatorTemplate=&#8221;{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}&#8221; rowsPerPageTemplate=&#8221;5,10,15&#8243; style=&#8221;width: 80%;margin-left: 10%;margin-right: 10%;&#8221;&gt; &lt;p:ajax &hellip;<\/p>\n","protected":false},"author":154,"featured_media":217,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[293,453],"class_list":["post-1119","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-jsf","tag-primefaces"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Lazy JSF Primefaces Datatable Pagination - Part 2 - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"The page code is very simple and there is no complication. Check the \u201cindex.xhtml\u201d code: &lt;!DOCTYPE html PUBLIC &quot;-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN&quot;\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Lazy JSF Primefaces Datatable Pagination - Part 2 - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"The page code is very simple and there is no complication. Check the \u201cindex.xhtml\u201d code: &lt;!DOCTYPE html PUBLIC &quot;-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2012-04-11T04:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-21T23:34:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/primefaces-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Hebert Coelho\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/uaiHebert\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hebert Coelho\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/lazy-jsf-primefaces-datatable_11.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/lazy-jsf-primefaces-datatable_11.html\"},\"author\":{\"name\":\"Hebert Coelho\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/997b72fad4d637a8d56a44ea7938ddf5\"},\"headline\":\"Lazy JSF Primefaces Datatable Pagination &#8211; Part 2\",\"datePublished\":\"2012-04-11T04:00:00+00:00\",\"dateModified\":\"2012-10-21T23:34:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/lazy-jsf-primefaces-datatable_11.html\"},\"wordCount\":296,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/lazy-jsf-primefaces-datatable_11.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/primefaces-logo.jpg\",\"keywords\":[\"JSF\",\"PrimeFaces\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/lazy-jsf-primefaces-datatable_11.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/lazy-jsf-primefaces-datatable_11.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/lazy-jsf-primefaces-datatable_11.html\",\"name\":\"Lazy JSF Primefaces Datatable Pagination - Part 2 - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/lazy-jsf-primefaces-datatable_11.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/lazy-jsf-primefaces-datatable_11.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/primefaces-logo.jpg\",\"datePublished\":\"2012-04-11T04:00:00+00:00\",\"dateModified\":\"2012-10-21T23:34:55+00:00\",\"description\":\"The page code is very simple and there is no complication. Check the \u201cindex.xhtml\u201d code: &lt;!DOCTYPE html PUBLIC \\\"-\\\/\\\/W3C\\\/\\\/DTD XHTML 1.0 Transitional\\\/\\\/EN\\\"\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/lazy-jsf-primefaces-datatable_11.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/lazy-jsf-primefaces-datatable_11.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/lazy-jsf-primefaces-datatable_11.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/primefaces-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/primefaces-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/lazy-jsf-primefaces-datatable_11.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Lazy JSF Primefaces Datatable Pagination &#8211; Part 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/997b72fad4d637a8d56a44ea7938ddf5\",\"name\":\"Hebert Coelho\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g\",\"caption\":\"Hebert Coelho\"},\"description\":\"Senior Java Development, with 4 certifications and a published book about JSF (portuguese only). Founder of the blog uaiHebert.com visited from more than 170 different countries.\",\"sameAs\":[\"http:\\\/\\\/uaihebert.com\\\/\",\"http:\\\/\\\/www.linkedin.com\\\/pub\\\/h%C3%A9bert-coelho-de-oliveira\\\/46\\\/ba8\\\/5bb\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/twitter.com\\\/uaiHebert\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Hebert-Coelho\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Lazy JSF Primefaces Datatable Pagination - Part 2 - Java Code Geeks","description":"The page code is very simple and there is no complication. Check the \u201cindex.xhtml\u201d code: &lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\"","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html","og_locale":"en_US","og_type":"article","og_title":"Lazy JSF Primefaces Datatable Pagination - Part 2 - Java Code Geeks","og_description":"The page code is very simple and there is no complication. Check the \u201cindex.xhtml\u201d code: &lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\"","og_url":"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2012-04-11T04:00:00+00:00","article_modified_time":"2012-10-21T23:34:55+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/primefaces-logo.jpg","type":"image\/jpeg"}],"author":"Hebert Coelho","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/uaiHebert","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Hebert Coelho","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html"},"author":{"name":"Hebert Coelho","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/997b72fad4d637a8d56a44ea7938ddf5"},"headline":"Lazy JSF Primefaces Datatable Pagination &#8211; Part 2","datePublished":"2012-04-11T04:00:00+00:00","dateModified":"2012-10-21T23:34:55+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html"},"wordCount":296,"commentCount":2,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/primefaces-logo.jpg","keywords":["JSF","PrimeFaces"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html","url":"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html","name":"Lazy JSF Primefaces Datatable Pagination - Part 2 - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/primefaces-logo.jpg","datePublished":"2012-04-11T04:00:00+00:00","dateModified":"2012-10-21T23:34:55+00:00","description":"The page code is very simple and there is no complication. Check the \u201cindex.xhtml\u201d code: &lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\"","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/primefaces-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/primefaces-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/lazy-jsf-primefaces-datatable_11.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Lazy JSF Primefaces Datatable Pagination &#8211; Part 2"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/997b72fad4d637a8d56a44ea7938ddf5","name":"Hebert Coelho","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g","caption":"Hebert Coelho"},"description":"Senior Java Development, with 4 certifications and a published book about JSF (portuguese only). Founder of the blog uaiHebert.com visited from more than 170 different countries.","sameAs":["http:\/\/uaihebert.com\/","http:\/\/www.linkedin.com\/pub\/h%C3%A9bert-coelho-de-oliveira\/46\/ba8\/5bb","https:\/\/x.com\/http:\/\/twitter.com\/uaiHebert"],"url":"https:\/\/www.javacodegeeks.com\/author\/Hebert-Coelho"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/154"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=1119"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1119\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/217"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=1119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=1119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=1119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}