• Search Container In Liferay

    Search Container is an utility by Liferay for showing the data from table(s) in structured way with many features such pagination of items, searching, sorting and many more.


    <%@page import="java.util.List"%> <%@page import="com.liferay.portal.kernel.model.User"%> <%@page import="com.liferay.portal.kernel.util.ListUtil"%> <%@page import="com.liferay.portal.kernel.service.UserLocalServiceUtil"%> <%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %> <% List<User> users = UserLocalServiceUtil.getUsers(-1,-1); System.out.println(users.size()); %> <liferay-ui:search-container total="<%=users.size()%>" var="searchContainer" delta="1" deltaConfigurable="true" emptyResultsMessage="Oops. There Are No Users To Display, Please add Users"> <liferay-ui:search-container-results results="<%=ListUtil.subList(users, searchContainer.getStart(),searchContainer.getEnd())%>" /> <liferay-ui:search-container-row className="com.liferay.portal.kernel.model.User" modelVar="user" keyProperty="userId" > <liferay-ui:search-container-column-text name="User Id" value="${user.userId}"/> <liferay-ui:search-container-column-text name="firstName" property="firstName"/> <liferay-ui:search-container-column-text name="lastName" property="lastName"/> <liferay-ui:search-container-column-text name="Email" value="${user.emailAddress}"/> </liferay-ui:search-container-row> <liferay-ui:search-iterator /> </liferay-ui:search-container>

    Above search Container have minimal tags just to show you the demonstration of it. lets see the different tags used in the search container one by one.

    < liferay-ui:search-container>

    This is the main tag used to declare the search container.
    total : total number of items available in the table.
    delta : items per page
    deltaConfigurable : Flag to allow user to change the item per page from UI
    emptyResultsMessage : Message To Display when there are no items

    < liferay-ui:search-container-results>

    Using this tag we can iterate through the list of items.
    result : A variable to hold result

    < liferay-ui:search-container-row>





  • 17 comments:

    1. thanks very good example

      ReplyDelete
    2. Business phone systems are crucial to your business's success. Read about business phone systems and the benefits of having a simple pbx phone system. Local Business Coupons New York,

      ReplyDelete
    3. The original triathletes were amazing. Dave Scott and Mark Allen accomplished amazing feats in triathlon long before technology took over the sport. http://millennialmoderator.com/how-to-write-a-job-description-that-will-attract-top-talent#fold

      ReplyDelete
    4. There are several aspects which can be to be considered when making the decision to rent or get a piece of property. canadian mortgage calculator This usually takes effect in the first 3 to 5 years of an loan. canada mortgage calculator

      ReplyDelete
    5. Deciding to start a business can be one of the most exhilarating decisions you make in your life. We are living in a world wherever everyone wants to make extra money and add to his income. Most people have achieved this by acquiring great business ideas. When one starts up a company, he must be ready to meet competition. It is important to note that you would not need to become rich or popular to succeed in business but have to think smartly. But there are a lot of moving parts and many different elements to consider. best public adjusters

      ReplyDelete
    6. When your business revenues hit the multiple six-figure+ range, business owners are typically faced with a new challenge in their business - creating new growth. Most business owners hire an Online Business Manager when they've hit the ceiling, feel frustrated, are stuck, and simply cannot grow the business anymore by being the only one in charge of everything! They realize that they must step out of being the one that is "DOING" making space to fully step into a leadership role in order to grow to 7-figures and beyond. مصور درون

      ReplyDelete
    7. Business phone systems are crucial to your business's success. Read about business phone systems and the benefits of having a simple pbx phone system. global warming

      ReplyDelete
    8. A great number of small business owners have a constant urge to expand. Of course, the mere idea of expanding and becoming a "big" business known to thousands and millions of people is fascinating. However, expansion is not all about finding a new office space and hiring new employees to fill the vacant seats. Virtual assistant services

      ReplyDelete
    9. Considered starting your own business? Wondered if there's a tried and true starting-business checklist, or better yet starting-small -business checklist? Looking for a "Starting Small Business 101" class? Help-starting-business courses are available online. Where do you turn for help starting up small business and with the steps starting your own business are certain to require? Freedom Insurance

      ReplyDelete
    10. Running a small business is as challenging as trekking to Mt. Everest without having oxygen cylinder, prior practice, and a valid map guide. The challenges are only because there are no authentic rules that can lead a small business towards success while other major obstacles comprise: low budget, limited manpower, and lack of efficient resources. cellufine products

      ReplyDelete
    11. There is noticeably a bundle to learn about this. I suppose you’ve made certain nice points in features also. 안전놀이터

      ReplyDelete
    12. London. The vibrant, beating heart of the United Kingdom. It's one of the world's most popular destinations for tourists, and for business travellers too. The amount of commerce that goes through London is staggering, with a financial centre second only to New York, and service industries that cater for both the UK, European and international markets. If you're a business traveller planning to fly to London, read this comprehensive guide on how to get from the airport to the city centre. DUI Attorney Vancouver WA

      ReplyDelete
    13. Is Technology Killing Creativity? No that is an impossibility. In fact creativity is more in demand than ever before. There has never been a better time in the history of the world for the average person to express and benefit from creativity. https://www.ozaironline.com.au/pages/air-conditioning-sydney

      ReplyDelete
    14. When talking about business related issues, solutions, and technologies, you will almost always group businesses as small and large. While the separation is there, it won't be wrong to say that in a modern where digital technologies prevail, it should not be a problem for small businesses to compete with large ones. best life insurance

      ReplyDelete
    15. This article assists individuals considering opening a small business. Several topics are covered, in the form of questions that need to be answered, and potential solutions to those questions. outdoor solutions

      ReplyDelete
    16. Running a small business is as challenging as trekking to Mt. Everest without having oxygen cylinder, prior practice, and a valid map guide. The challenges are only because there are no authentic rules that can lead a small business towards success while other major obstacles comprise: low budget, limited manpower, and lack of efficient resources. concealed carry texas class

      ReplyDelete
    17. Running a small business is as challenging as trekking to Mt. Everest without having oxygen cylinder, prior practice, and a valid map guide. The challenges are only because there are no authentic rules that can lead a small business towards success while other major obstacles comprise: low budget, limited manpower, and lack of efficient resources. cara memisahkan file pdf

      ReplyDelete