Your most unhappy customers are your greatest source of learning.

Pagination in Liferay 6.1

July 27, 2012

Guys if you are thinking to put pagination in liferay,
use below code which is absolutely running properly and i would be putting more information regarding pagination with some more feature which supppoted by OOB liferay pagination.

<%@ taglib uri="" prefix="portlet" %>
<%@ taglib uri="" prefix="liferay-theme" %>
<%@ taglib uri="" prefix="liferay-ui" %>

<%@page import="javax.portlet.PortletURL"%>
<%@page import="java.util.List"%>
<%@page import="com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil"%>
<%@page import="com.liferay.portlet.journal.model.JournalArticle"%>

    List list= JournalArticleLocalServiceUtil.getArticles(themeDisplay.getScopeGroupId());
    Integer count = list.size();        
    Integer delta = (Integer)request.getAttribute("delta");        
    Integer cur = (Integer)request.getAttribute("cur");        
    if(cur == null){
        cur = 1;
    if(delta == null){
        delta = 20;
    if(count == null){
        count = 0;
    PortletURL portletURL = renderResponse.createActionURL();

Stay Tune for more information !!!



1 comment:

Mohammad Azaruddin said...

Thank you for sharing this article.

I just want to know from where we are getting delta and cur in these line:
Integer delta = (Integer)request.getAttribute("delta");
Integer cur = (Integer)request.getAttribute("cur");

And also the use of action URl: PortletURL portletURL = renderResponse.createActionURL();