Only fools use their mouth to speak. A smart man uses his brain, and a wise man uses his heart.- By Jack Ma - Founder of Alibaba.com

Pagination in Liferay 6.1

Friday, 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="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<%@ taglib uri="http://liferay.com/tld/ui" 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...

Hi
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();

 

Members