• 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>





  • 12 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. If a house becomes unsafe to live in due to structural damage caused by natural disasters like earthquake, tornado or hurricane, or by insect infestation or severe cases of mold and other allergens that can pose some health risk to the home dwellers, then it is time to demolish it and build a new one. - If a building is old and decrepit and shows some structural instability and it becomes a possible threat to the public, then it's time to demolish it. What does a demolition contractor do? lagos postal code

      ReplyDelete
    10. 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
    11. 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
    12. There is noticeably a bundle to learn about this. I suppose you’ve made certain nice points in features also. 안전놀이터

      ReplyDelete